note 40288 added to function.trim
| From: | phoenix at frost-byte dot ca | Date: | Fri, 27 Feb 2004 14:17:44 +0000 |
| Subject: | note 40288 added to function.trim | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-65885@lists.php.net to get a copy of this message | ||
It should be noted that doing something like
-------------
$test='What is the something something something?" ';
$test=trim($test, "\x22\x27");//trim single & double quotes.
-------------
will not change the string AT ALL (it will not even remove the whitespace.
It seems that the list of characters you specify for the trimming is not in addition to the default
characters, but in replacement to them. To remove all of the normal characters AND double and
single quotes, for example, call:
-------------
$test='What is the something something something?" ';
$test=trim($test, "\x20\x09\x0A\x0D\x00\x0B\x22\x27");
-------------
----
Manual Page -- http://www.php.net/manual/en/function.trim.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+40288
Delete -- http://master.php.net/manage/user-notes.php?action=delete+40288&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+40288&report=yes
Search -- http://master.php.net/manage/user-notes.php