note 65569 added to function.strrpos

From: Date: Wed, 03 May 2006 18:31:08 +0000
Subject: note 65569 added to function.strrpos
Groups: php.notes 
Request: Send a blank email to php-notes+get-110463@lists.php.net to get a copy of this message
In strrstr function in php 4 there is also no offset. <? // by Shimon Doodkin function chrrpos($haystack, $needle, $offset=false) { $needle=$needle[0]; $l=strlen($haystack); if($l==0) return false; if($offset===false) $offset=$l-1; else { if($offset>$l) $offset=$l-1; if($offset<0) return false; } for(;$offset>0;$offset--) if($haystack[$offset]==$needle) return $offset; return false; } ?> ---- Server IP: 62.90.26.70 Probable Submitter: 85.64.11.204 ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/function.strrpos.php Edit -- http://master.php.net/note/edit/65569 Del: integrated -- http://master.php.net/note/delete/65569/integrated Del: useless -- http://master.php.net/note/delete/65569/useless Del: bad code -- http://master.php.net/note/delete/65569/bad+code Del: spam -- http://master.php.net/note/delete/65569/spam Del: non-english -- http://master.php.net/note/delete/65569/non-english Del: in docs -- http://master.php.net/note/delete/65569/in+docs Del: other reasons-- http://master.php.net/note/delete/65569 Reject -- http://master.php.net/note/reject/65569 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#110463) next »