note 83267 added to tutorial.useful
| From: | admin at thaisharecity dot com | Date: | Sun, 18 May 2008 01:37:57 +0000 |
| Subject: | note 83267 added to tutorial.useful | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-139495@lists.php.net to get a copy of this message | ||
You should try in many situation.
<?php
$pos_str = "ABCDEFGH";
if(strpos($pos_str, "B") == true)
{
echo "True";
}
else
{
echo "False";
}
?>
It'll output True.
But if you change strpos($pos_str, "B") to strpos($pos_str, "A")
It return false.
So using !== false is correct.
----
Server IP: 203.121.145.99
Probable Submitter: 125.25.42.7
----
Manual Page -- http://www.php.net/manual/en/tutorial.useful.php
Edit -- https://master.php.net/note/edit/83267
Del: integrated -- https://master.php.net/note/delete/83267/integrated
Del: useless -- https://master.php.net/note/delete/83267/useless
Del: bad code -- https://master.php.net/note/delete/83267/bad+code
Del: spam -- https://master.php.net/note/delete/83267/spam
Del: non-english -- https://master.php.net/note/delete/83267/non-english
Del: in docs -- https://master.php.net/note/delete/83267/in+docs
Del: other reasons-- https://master.php.net/note/delete/83267
Reject -- https://master.php.net/note/reject/83267
Search -- https://master.php.net/manage/user-notes.php