note 23946 deleted from function.strrchr by dams
| From: | dams@php.net | Date: | Sat, 03 Aug 2002 03:06:57 +0000 |
| Subject: | note 23946 deleted from function.strrchr by dams | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-34186@lists.php.net to get a copy of this message | ||
the example is stupid:
// get last directory in $PATH
$dir = substr(strrchr($PATH, ":"), 1);
// get everything after last newline
$text = "Line 1\nLine 2\nLine 3";
$last = substr(strrchr($text, "\n"), 1 );
Now the "10" was changed to a "\n"... not everyone knows the ASCII table by
heart!