note 94850 added to function.in-array
| From: | blade39 at kolosstudio dot ru | Date: | Sat, 28 Nov 2009 14:17:49 +0000 |
| Subject: | note 94850 added to function.in-array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-163362@lists.php.net to get a copy of this message | ||
Found strange things, for example create such array
$arSortFields=array('id','title);
and do such thing
echo intval(in_array(0,$arSortFields));
You will get "1" in echo! Thats means that element 0 is in array!
But if you do
echo intval(in_array(0,array());
you will got 0 as expected.
So be carefull to pass 0 as first parameter
----
Server IP: 195.54.192.44
Probable Submitter: 80.70.233.3
----
Manual Page -- http://www.php.net/manual/en/function.in-array.php
Edit -- https://master.php.net/note/edit/94850
Del: integrated -- https://master.php.net/note/delete/94850/integrated
Del: useless -- https://master.php.net/note/delete/94850/useless
Del: bad code -- https://master.php.net/note/delete/94850/bad+code
Del: spam -- https://master.php.net/note/delete/94850/spam
Del: non-english -- https://master.php.net/note/delete/94850/non-english
Del: in docs -- https://master.php.net/note/delete/94850/in+docs
Del: other reasons-- https://master.php.net/note/delete/94850
Reject -- https://master.php.net/note/reject/94850
Search -- https://master.php.net/manage/user-notes.php