note 85419 deleted from function.in-array by danbrown
| From: | danbrown@php.net | Date: | Mon, 08 Jun 2009 21:39:43 +0000 |
| Subject: | note 85419 deleted from function.in-array by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-156495@lists.php.net to get a copy of this message | ||
Note Submitter: Nemo Pohle
----
This is another implementation of the in_arrayr() function found further down below which
didn't really work (it returned upon finding the first nested array and ignoring all other
nested arrays).
<?php
function in_arrayr($needle, $haystack, &$found = false) {
foreach ($haystack as $v) {
if ($needle == $v) {
$found = true;
return true;
} elseif (is_array($v)) {
$this->in_arrayr($needle, $v, $found);
}
}
return $found;
}
?>