note 54218 added to function.strripos

From: Date: Mon, 27 Jun 2005 15:16:41 +0000
Subject: note 54218 added to function.strripos
Groups: php.notes 
Request: Send a blank email to php-notes+get-91030@lists.php.net to get a copy of this message
this function seems to disregard the "offset" variable. for instance, when i do the example above using the offset value, it's incorrect: <?php $haystack = 'this is a string with spaces.'; $needle = ' '; $pos = strripos($haystack, $needle, 13); if ($pos !== false) { echo "We found the last ($needle) in ($haystack) at position ($pos)"; } ?> it returns 21, but should return 9. ---- Manual Page -- http://www.php.net/manual/en/function.strripos.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+54218 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+54218&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+54218&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+54218&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+54218&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+54218&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+54218&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+54218&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#91030) next »