note 29250 added to function.strrpos

From: Date: Fri, 07 Feb 2003 12:45:59 +0000
Subject: note 29250 added to function.strrpos
Groups: php.notes 
Request: Send a blank email to php-notes+get-43551@lists.php.net to get a copy of this message
For beginners: Note: <?php $mystring = "asasdb"; $pos = strrpos($mystring, "b"); if ($pos == true){ echo $pos;} ?> would give you $pos = 5 and not pos$ = 6 as you would expect. reason = it start's count on 0, and not 1. -- http://www.php.net/manual/en/function.strrpos.php http://master.php.net/manage/user-notes.php?action=edit+29250 http://master.php.net/manage/user-notes.php?action=delete+29250 http://master.php.net/manage/user-notes.php?action=reject+29250

« previous php.notes (#43551) next »