note 78001 added to function.strrpos
| From: | pb at tdcspace dot dk | Date: | Sun, 23 Sep 2007 14:26:31 +0000 |
| Subject: | note 78001 added to function.strrpos | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-130713@lists.php.net to get a copy of this message | ||
what the hell are you all doing. Wanna find the *next* last from a specific position because strrpos
is useless with the "offset" option, then....
ex: find 'Z' in $str from position $p, backward...
while($p > -1 and $str{$p} <> 'Z') $p--;
Anyone will notice $p = -1 means: *not found* and that you must ensure a valid start offset in $p,
that is >=0 and < string length. Doh
----
Server IP: 69.147.83.197
Probable Submitter: 87.72.50.122
----
Manual Page -- http://www.php.net/manual/en/function.strrpos.php
Edit -- https://master.php.net/note/edit/78001
Del: integrated -- https://master.php.net/note/delete/78001/integrated
Del: useless -- https://master.php.net/note/delete/78001/useless
Del: bad code -- https://master.php.net/note/delete/78001/bad+code
Del: spam -- https://master.php.net/note/delete/78001/spam
Del: non-english -- https://master.php.net/note/delete/78001/non-english
Del: in docs -- https://master.php.net/note/delete/78001/in+docs
Del: other reasons-- https://master.php.net/note/delete/78001
Reject -- https://master.php.net/note/reject/78001
Search -- https://master.php.net/manage/user-notes.php