note 109484 added to function.ltrim
| From: | pLIMP | Date: | Fri, 20 Jul 2012 19:51:15 +0000 |
| Subject: | note 109484 added to function.ltrim | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-189343@lists.php.net to get a copy of this message | ||
Function similar to ltrim only it will remove everything from the start of the string to the last
occurence of anything in the $charlist
<?php
function lstrip($string, $charlist) {
// removes everything from start of string to last occurence of char in charlist
$charlist = str_split($charlist);
foreach ($charlist as $char) {
$pos = max(strrpos($string, $char), $pos);
}
$string_stripped = substr($string, $pos + 1);
return $string_stripped;
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 24.89.139.58
----
Manual Page -- http://www.php.net/manual/en/function.ltrim.php
Edit -- https://master.php.net/note/edit/109484
Del: integrated -- https://master.php.net/note/delete/109484/integrated
Del: useless -- https://master.php.net/note/delete/109484/useless
Del: bad code -- https://master.php.net/note/delete/109484/bad+code
Del: spam -- https://master.php.net/note/delete/109484/spam
Del: non-english -- https://master.php.net/note/delete/109484/non-english
Del: in docs -- https://master.php.net/note/delete/109484/in+docs
Del: other reasons-- https://master.php.net/note/delete/109484
Reject -- https://master.php.net/note/reject/109484
Search -- https://master.php.net/manage/user-notes.php