note 123735 added to function.trim
| From: | igor dot pellegrini at berlinonline dot de | Date: | Thu, 04 Apr 2019 10:36:22 +0000 |
| Subject: | note 123735 added to function.trim | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-210517@lists.php.net to get a copy of this message | ||
Beware with trimming apparently innocent characters. It is NOT a Unicode-safe function:
<?php
echo trim('â [Approximation sign]', 'â [en-dash]'); // ��
[Approximation sig
?>
The en-dash here is breaking the Unicode characters.
And also prevents the open-square-bracket from being seen as part of the characters to trim on the
left side, letting it untouched in the resulting string.
----
Server IP: 208.43.231.9
Probable Submitter: 185.85.3.142 (proxied: 217.27.204.228)
----
Manual Page -- http://php.net/manual/en/function.trim.php
Edit -- https://master.php.net/note/edit/123735
Del: integrated -- https://master.php.net/note/delete/123735/integrated
Del: useless -- https://master.php.net/note/delete/123735/useless
Del: bad code -- https://master.php.net/note/delete/123735/bad+code
Del: spam -- https://master.php.net/note/delete/123735/spam
Del: non-english -- https://master.php.net/note/delete/123735/non-english
Del: in docs -- https://master.php.net/note/delete/123735/in+docs
Del: other reasons-- https://master.php.net/note/delete/123735
Reject -- https://master.php.net/note/reject/123735
Search -- https://master.php.net/manage/user-notes.php