Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Web Design & Development
Tag Cloud
access acer asus bios bsod computer crash driver drivers error ethernet excel freeze gaming gpu hard drive hardware hdmi internet laptop mac malware memory monitor motherboard music network printer problem ram registry router server slow software sound trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
PHP Bug?

Reply  
Thread Tools
MMJ's Avatar
MMJ MMJ is offline
Senior Member with 3,637 posts.
 
Join Date: Oct 2006
22-May-2007, 12:38 PM #1
PHP Bug?
WTF?

PHP Code:
echo rtrim("s/asd""/asd"); //Outputs nothing
echo rtrim("wws/asd""/asd"); //Outputs ww 
Why doesn't this work???

If I replace "s" with q it works. However if I replace "s" with "q" and "asd" with "qsd" it doesn't work. Why???

EDIT:

It seems the characters don't have to be in order. How could I fix this?

Last edited by MMJ; 22-May-2007 at 12:46 PM..
cpscdave's Avatar
Member with 399 posts.
 
Join Date: Feb 2004
Experience: Intermediate
22-May-2007, 01:33 PM #2
what exactly are you trying to do?

Are you trying to get it to output:

just s in the first case?

from http://ca3.php.net/rtrim

Quote:
rtrim — Strip whitespace (or other characters) from the end of a string
MMJ's Avatar
MMJ MMJ is offline
Senior Member with 3,637 posts.
 
Join Date: Oct 2006
22-May-2007, 02:21 PM #3
I got it solved but was wondering how could I make it so that it only removes characters in order.

i.e.
PHP Code:
rtrim('This is a short short sentence''cents');
// returns 'This is a short short ' 
So characters have to be in order.
Reply

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 05:42 PM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.