note 71097 added to function.strpos
| From: | star2105 at gmail dot com | Date: | Sun, 12 Nov 2006 07:33:06 +0000 |
| Subject: | note 71097 added to function.strpos | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-119620@lists.php.net to get a copy of this message | ||
when using this function, instead of being able to handele a 'not found' notion of the
function, the script stops (jumps out of function) and the next line is displayed in the browser:
Warning: strpos() [function.strpos]: Empty delimiter. in C:\wamp\www\test.php on line 21
code looks like this:
19 $subject = "abc";
20 $find = "f";
21 $pos = strpos($subject,$find);
22 if ($pos !== FALSE)
23 {
please advise
----
Server IP: 82.146.33.222
Probable Submitter: 84.193.12.39
----
Manual Page -- http://www.php.net/manual/en/function.strpos.php
Edit -- https://master.php.net/note/edit/71097
Del: integrated -- https://master.php.net/note/delete/71097/integrated
Del: useless -- https://master.php.net/note/delete/71097/useless
Del: bad code -- https://master.php.net/note/delete/71097/bad+code
Del: spam -- https://master.php.net/note/delete/71097/spam
Del: non-english -- https://master.php.net/note/delete/71097/non-english
Del: in docs -- https://master.php.net/note/delete/71097/in+docs
Del: other reasons-- https://master.php.net/note/delete/71097
Reject -- https://master.php.net/note/reject/71097
Search -- https://master.php.net/manage/user-notes.php