note 89732 added to function.strpos
| From: | andrasz at gmail dot com | Date: | Fri, 20 Mar 2009 18:56:05 +0000 |
| Subject: | note 89732 added to function.strpos | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-152220@lists.php.net to get a copy of this message | ||
@jburns131
I think casting is useless in that case, because 0 has *not* the same type as null.
So the following code does the job :
if($needlePos === 0) {
echo "db is in position zero";
} else {
echo "db is NOT in position zero";
}
----
Server IP: 89.31.146.176
Probable Submitter: 86.71.111.243
----
Manual Page -- http://www.php.net/manual/en/function.strpos.php
Edit -- https://master.php.net/note/edit/89732
Del: integrated -- https://master.php.net/note/delete/89732/integrated
Del: useless -- https://master.php.net/note/delete/89732/useless
Del: bad code -- https://master.php.net/note/delete/89732/bad+code
Del: spam -- https://master.php.net/note/delete/89732/spam
Del: non-english -- https://master.php.net/note/delete/89732/non-english
Del: in docs -- https://master.php.net/note/delete/89732/in+docs
Del: other reasons-- https://master.php.net/note/delete/89732
Reject -- https://master.php.net/note/reject/89732
Search -- https://master.php.net/manage/user-notes.php