note 83674 added to function.trim
| From: | deeceezzz at hotmail dot com | Date: | Fri, 06 Jun 2008 22:21:32 +0000 |
| Subject: | note 83674 added to function.trim | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-140194@lists.php.net to get a copy of this message | ||
Has anyone seen this one :
trim('bla', &);
returns bl
but
trim('blo', &);
returns blo
I don't get why a is removed like this if placed at the end of the string, but, in case you
want to make sure that no & are used at the begining or at the end of a string you'd
better use :
preg_replace('
(^&|&$)i', '', $my_string);
Hope this helps
----
Server IP: 69.147.83.197
Probable Submitter: 82.66.170.151
----
Manual Page -- http://www.php.net/manual/en/function.trim.php
Edit -- https://master.php.net/note/edit/83674
Del: integrated -- https://master.php.net/note/delete/83674/integrated
Del: useless -- https://master.php.net/note/delete/83674/useless
Del: bad code -- https://master.php.net/note/delete/83674/bad+code
Del: spam -- https://master.php.net/note/delete/83674/spam
Del: non-english -- https://master.php.net/note/delete/83674/non-english
Del: in docs -- https://master.php.net/note/delete/83674/in+docs
Del: other reasons-- https://master.php.net/note/delete/83674
Reject -- https://master.php.net/note/reject/83674
Search -- https://master.php.net/manage/user-notes.php