note 118268 added to function.in-array
| From: | splogamurugan at gmail dot com | Date: | Fri, 06 Nov 2015 11:50:00 +0000 |
| Subject: | note 118268 added to function.in-array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-204094@lists.php.net to get a copy of this message | ||
var_dump(in_array('invalid', array(0,10,20)));
The above code gives true since the 'invalid' is getting converted to 0 and checked
against the array(0,10,20)
but var_dump(in_array('invalid', array(10,20))); gives 'false' since 0 not
there in the array
----
Server IP: 72.52.91.14
Probable Submitter: 122.248.163.3
----
Manual Page -- http://php.net/manual/en/function.in-array.php
Edit -- https://master.php.net/note/edit/118268
Del: integrated -- https://master.php.net/note/delete/118268/integrated
Del: useless -- https://master.php.net/note/delete/118268/useless
Del: bad code -- https://master.php.net/note/delete/118268/bad+code
Del: spam -- https://master.php.net/note/delete/118268/spam
Del: non-english -- https://master.php.net/note/delete/118268/non-english
Del: in docs -- https://master.php.net/note/delete/118268/in+docs
Del: other reasons-- https://master.php.net/note/delete/118268
Reject -- https://master.php.net/note/reject/118268
Search -- https://master.php.net/manage/user-notes.php