note 40288 deleted from function.trim by nlopess
| From: | nlopess@php.net | Date: | Fri, 27 Feb 2004 14:47:23 +0000 |
| Subject: | note 40288 deleted from function.trim by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-65889@lists.php.net to get a copy of this message | ||
Note Submitter: phoenix@frost-byte.ca
----
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");
-------------