note 72160 deleted from function.in-array by felipe
| From: | felipe@php.net | Date: | Sun, 30 Dec 2007 19:00:44 +0000 |
| Subject: | note 72160 deleted from function.in-array by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-134494@lists.php.net to get a copy of this message | ||
Note Submitter: vandor at ahimsa dot hu
----
this "14-Jan-2006 06:44" example correctly:
in_arrayr -- Checks if the value is in an array recursively
Description
bool in_array (mixed needle, array haystack)
<?
function in_arrayr($needle, $haystack) {
foreach ($haystack as $v) {
if ($needle == $v) return true;
elseif (is_array($v)) {
if (in_arrayr($needle, $v) === true) return true;
}
}
return false;
}
?>