note 31232 added to function.strrchr
| From: | marcokonopacki at hotmail dot com | Date: | Mon, 14 Apr 2003 17:43:48 +0000 |
| Subject: | note 31232 added to function.strrchr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-46608@lists.php.net to get a copy of this message | ||
<?
// Reverse search of strrchr.
function strrrchr($haystack,$needle)
{
// Returns everything before $needle (inclusive).
return substr($haystack,0,strpos($haystack,$needle)+1);
}
$string = "FIELD NUMBER(9) NOT NULL";
echo strrrchr($string,")"); // Will print FIELD (9)
?>
--
http://www.php.net/manual/en/function.strrchr.php
http://master.php.net/manage/user-notes.php?action=edit+31232
http://master.php.net/manage/user-notes.php?action=delete+31232
http://master.php.net/manage/user-notes.php?action=reject+31232