note 83243 deleted from tutorial.useful by philip
| From: | philip@php.net | Date: | Fri, 13 Jun 2008 04:36:46 +0000 |
| Subject: | note 83243 deleted from tutorial.useful by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-140401@lists.php.net to get a copy of this message | ||
Note Submitter: gz at example dot com
----
tomcraig:
If the search string is in the first position (i.e. position[0]), then your coditional will resolve
to false.
anonymous:
"The function should return TRUE on any non-zero value." The strpos() function never
returns true. It returns, as daniel says, either false or an integer. That includes 0, which
evaluates to false if using "==". Also note that the manual text (as you yourself quote
it) says that, in the case of an unsuccessful search, the if expression evaluates to true, not that
the strpos() function returns true (which, again, it never does).
Mark:
"Try it with == TRUE. It works fine..." Sure it does, as long as the search string is not
in the first position.
The manual and daniel are correct.