note 96625 added to function.strripos

From: Date: Tue, 09 Mar 2010 03:00:53 +0000
Subject: note 96625 added to function.strripos
Groups: php.notes 
Request: Send a blank email to php-notes+get-166803@lists.php.net to get a copy of this message
strripos() has very strange behaviour when you provide search position. For some reason it searches forward from the given position, instead of searching backward, that is more logical. For example if you want to find instanse of $what, previous to the last, strripos($where, $what, $last_what_pos-1) will not wark as expected. It will return $last_what_pos again and again. And that has no sence at all. To prevent this, I just used $prev_last_what_pos = strripos(substr($where,0,$last_what_pos), $what); ---- Server IP: 78.41.106.3 Probable Submitter: 94.51.128.104 ---- Manual Page -- http://www.php.net/manual/en/function.strripos.php Edit -- https://master.php.net/note/edit/96625 Del: integrated -- https://master.php.net/note/delete/96625/integrated Del: useless -- https://master.php.net/note/delete/96625/useless Del: bad code -- https://master.php.net/note/delete/96625/bad+code Del: spam -- https://master.php.net/note/delete/96625/spam Del: non-english -- https://master.php.net/note/delete/96625/non-english Del: in docs -- https://master.php.net/note/delete/96625/in+docs Del: other reasons-- https://master.php.net/note/delete/96625 Reject -- https://master.php.net/note/reject/96625 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#166803) next »