note 39454 added to function.strrchr
| From: | melker at jazzfree dot com | Date: | Thu, 29 Jan 2004 10:10:31 +0000 |
| Subject: | note 39454 added to function.strrchr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-64356@lists.php.net to get a copy of this message | ||
Here's a slightly simpler way than marcokonopacki's of reversing the function of
strrchr(). To return the part of $this that goes before the last occurrence of $char:
<?
substr($this,0,-strlen(strrchr($this,$char)))
?>
Is there a lastIndexOf for PHP coming?
----
Manual Page -- http://www.php.net/manual/en/function.strrchr.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+39454
Delete -- http://master.php.net/manage/user-notes.php?action=delete+39454&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+39454&report=yes
Search -- http://master.php.net/manage/user-notes.php