note 120959 deleted from function.in-array by peehaa
| From: | peehaa@php.net | Date: | Mon, 10 Apr 2017 07:49:46 +0000 |
| Subject: | note 120959 deleted from function.in-array by peehaa | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-209017@lists.php.net to get a copy of this message | ||
Note Submitter: jayanthram1991 at gmail dot com
----
$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