note 23656 added to function.strpos
| From: | dont at spam dot net | Date: | Wed, 24 Jul 2002 11:14:26 +0000 |
| Subject: | note 23656 added to function.strpos | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-33487@lists.php.net to get a copy of this message | ||
To: redeagle@chello.nl
Zero (0) is not a false result; it is a valid answer. The function returns 0 because "abc"
does indeed contain "abc" and the first occurence of the target string starts at position
0.
Use === to test if the function returned true or false.
--
http://www.php.net/manual/en/function.strpos.php
http://master.php.net/manage/user-notes.php?action=edit+23656
http://master.php.net/manage/user-notes.php?action=delete+23656
http://master.php.net/manage/user-notes.php?action=reject+23656