note 120959 added to function.in-array
| From: | jayanthram1991 at gmail dot com | Date: | Mon, 10 Apr 2017 05:57:10 +0000 |
| Subject: | note 120959 added to function.in-array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-209016@lists.php.net to get a copy of this message | ||
$people = array("Peter", "Joe", "Glenn", "Cleveland");
if (in_array(0, $people)) {
echo "Match found";
} else {
echo "Match not found";
}
-------output
it's giving match found!!
where is 0 in the array!!
-------
if (in_array(1, $people)) {
echo "Match found";
} else {
echo "Match not found";
}
-------output
it's giving match not found!!
if (in_array(null, $people)) {
echo "Match found";
} else {
echo "Match not found";
}
-------output
it's giving match not found!!
guys use 3 argument TRUE for in_array
----
Server IP: 72.52.91.14
Probable Submitter: 115.98.209.182
----
Manual Page -- http://php.net/manual/en/function.in-array.php
Edit -- https://master.php.net/note/edit/120959
Del: integrated -- https://master.php.net/note/delete/120959/integrated
Del: useless -- https://master.php.net/note/delete/120959/useless
Del: bad code -- https://master.php.net/note/delete/120959/bad+code
Del: spam -- https://master.php.net/note/delete/120959/spam
Del: non-english -- https://master.php.net/note/delete/120959/non-english
Del: in docs -- https://master.php.net/note/delete/120959/in+docs
Del: other reasons-- https://master.php.net/note/delete/120959
Reject -- https://master.php.net/note/reject/120959
Search -- https://master.php.net/manage/user-notes.php