note 101976 added to function.in-array
| From: | bosdilooda at gmail dot com | Date: | Fri, 21 Jan 2011 08:07:08 +0000 |
| Subject: | note 101976 added to function.in-array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-175957@lists.php.net to get a copy of this message | ||
There should be a big red warning sign here because this function behaves in mysterious ways...
let haystack be an array of integers:
$arr = array(1,2,3,4,5);
let $needle be a string of "2foobar"
then
in_array($needle,$arr)
will return true because string ("2foobar") evaluates to integer (2).
----
Server IP: 80.81.171.181
Probable Submitter: 194.100.53.62
----
Manual Page -- http://www.php.net/manual/en/function.in-array.php
Edit -- https://master.php.net/note/edit/101976
Del: integrated -- https://master.php.net/note/delete/101976/integrated
Del: useless -- https://master.php.net/note/delete/101976/useless
Del: bad code -- https://master.php.net/note/delete/101976/bad+code
Del: spam -- https://master.php.net/note/delete/101976/spam
Del: non-english -- https://master.php.net/note/delete/101976/non-english
Del: in docs -- https://master.php.net/note/delete/101976/in+docs
Del: other reasons-- https://master.php.net/note/delete/101976
Reject -- https://master.php.net/note/reject/101976
Search -- https://master.php.net/manage/user-notes.php