note 104255 added to function.strpos
| From: | Jan at osu1 dot php dot net | Date: | Fri, 03 Jun 2011 18:52:00 +0000 |
| Subject: | note 104255 added to function.strpos | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-180239@lists.php.net to get a copy of this message | ||
@akarmenia, your version is not returning the first occurrence of any of the needles, but only the
first occurence of the first found needle!
try:
<?php echo strpos_array('That is a test', array('a', 'is')); ?>
Output will be 8 (for the 'a'), but I expect 5 (for 'is').
----
Server IP: 85.214.154.209
Probable Submitter: 85.178.168.205
----
Manual Page -- http://www.php.net/manual/en/function.strpos.php
Edit -- https://master.php.net/note/edit/104255
Del: integrated -- https://master.php.net/note/delete/104255/integrated
Del: useless -- https://master.php.net/note/delete/104255/useless
Del: bad code -- https://master.php.net/note/delete/104255/bad+code
Del: spam -- https://master.php.net/note/delete/104255/spam
Del: non-english -- https://master.php.net/note/delete/104255/non-english
Del: in docs -- https://master.php.net/note/delete/104255/in+docs
Del: other reasons-- https://master.php.net/note/delete/104255
Reject -- https://master.php.net/note/reject/104255
Search -- https://master.php.net/manage/user-notes.php