note 126588 added to function.ltrim
| From: | seba dot szwarc at gmail dot com | Date: | Sun, 14 Nov 2021 12:38:25 +0000 |
| Subject: | note 126588 added to function.ltrim | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-217203@lists.php.net to get a copy of this message | ||
It's worth noting that ltrim() removes also each occurence of the characters defined in
substring which gives unexpected results:
Example:
````
$s = "#primaryKey:artist_type_id\u{002}\n";
$strip = ltrim($s,"#primaryKey:");
````
gives "tist_type_id" because "ar" pattern is found in 2nd argument.
That makes ltrim function unusable in pattern extraction if you don't know what data to be
expected.
----
Server IP: 45.112.84.4
Probable Submitter: 45.112.85.242 (proxied: 77.65.85.96)
----
Manual Page -- https://php.net/manual/en/function.ltrim.php
Edit -- https://main.php.net/note/edit/126588
Del: integrated -- https://main.php.net/note/delete/126588/integrated
Del: useless -- https://main.php.net/note/delete/126588/useless
Del: bad code -- https://main.php.net/note/delete/126588/bad+code
Del: spam -- https://main.php.net/note/delete/126588/spam
Del: non-english -- https://main.php.net/note/delete/126588/non-english
Del: in docs -- https://main.php.net/note/delete/126588/in+docs
Del: other reasons-- https://main.php.net/note/delete/126588
Reject -- https://main.php.net/note/reject/126588
Search -- https://main.php.net/manage/user-notes.php