List Info

Thread: note 36710 deleted from function.rtrim by betz




note 36710 deleted from function.rtrim by betz
user name
2006-02-09 16:40:46
Note Submitter: me at prestonhunt dot com 

----

You have to careful when specifying the second parameter
(charlist) of rtrim.  It appears that you must use string
interpolation (double quotes instead of single quotes) or it
won't work like you expect.  For instance, if you wanted to
strip spaces and tabs, this would not work:

rtrim("Ends in t   ", ' t') returns "Ends
in" (apparently rtrim is stripping spaces, slashes, and
t's).

If you specify this instead (note use of double quotes on
second parameter):

rtrim("Ends in t  ", " t") it returns
the correct result ("Ends in t")

Maybe this is obvious, but I thought I would share it since
it was messing me up and took some time to figure out.

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )