note 126588 deleted from function.ltrim by cmb
| From: | cmb@php.net | Date: | Sun, 14 Nov 2021 12:48:53 +0000 |
| Subject: | note 126588 deleted from function.ltrim by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-217205@lists.php.net to get a copy of this message | ||
Note Submitter: seba dot szwarc at gmail dot com
----
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.