note 24547 deleted from function.in-array by felipe
| From: | felipe@php.net | Date: | Sun, 30 Dec 2007 18:48:12 +0000 |
| Subject: | note 24547 deleted from function.in-array by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-134466@lists.php.net to get a copy of this message | ||
Note Submitter: leighnus at mbox dot com dot au
----
Alternative method to find an array within an array (if your version of php doesn't support
array type $needles):
function array_in_array($needle, $haystack) {
foreach ($haystack as $value) {
if ($needle == $value)
return true;
}
return false;
}