note 51100 added to ref.strings
| From: | Pommef at osu1 dot php dot net | Date: | Sat, 19 Mar 2005 21:15:57 +0000 |
| Subject: | note 51100 added to ref.strings | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-86696@lists.php.net to get a copy of this message | ||
Example: Give me everything up to the fourth occurance of '/'.
<?php
$haystack = "/home/username/www/index.php";
$needle = "/";
function strnpos($haystack, $needle, $occurance, $pos = 0) {
$res = implode($needle,$haystack);
$res = array_slice($res, $pos, $occurance);
return explode ($needle,$res);
}
?>
----
Manual Page -- http://www.php.net/manual/en/ref.strings.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+51100
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51100&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51100&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51100&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51100&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51100&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+51100&report=yes
Search -- http://master.php.net/manage/user-notes.php