note 111455 added to function.strstr
| From: | xslidian at lidian dot info | Date: | Thu, 21 Feb 2013 07:37:50 +0000 |
| Subject: | note 111455 added to function.strstr | ||
| Groups: | php.notes php.notes | ||
| Request: | Send a blank email to php-notes+get-193713@lists.php.net to get a copy of this message | ||
For those in need of the last occurrence of a string:
<?php
function strrstr($h, $n, $before = false) {
$rpos = strrpos($h, $n);
if($rpos === false) return false;
if($before == false) return substr($h, $rpos);
else return substr($h, 0, $rpos);
}
?>
----
Server IP: 69.147.83.199
Probable Submitter: 112.21.254.250
----
Manual Page -- http://php.net/manual/en/function.strstr.php
Edit -- https://master.php.net/note/edit/111455
Del: integrated -- https://master.php.net/note/delete/111455/integrated
Del: useless -- https://master.php.net/note/delete/111455/useless
Del: bad code -- https://master.php.net/note/delete/111455/bad+code
Del: spam -- https://master.php.net/note/delete/111455/spam
Del: non-english -- https://master.php.net/note/delete/111455/non-english
Del: in docs -- https://master.php.net/note/delete/111455/in+docs
Del: other reasons-- https://master.php.net/note/delete/111455
Reject -- https://master.php.net/note/reject/111455
Search -- https://master.php.net/manage/user-notes.php