note 60721 deleted from function.in-array by hholzgra
| From: | hholzgra@php.net | Date: | Sun, 06 Aug 2006 11:59:14 +0000 |
| Subject: | note 60721 deleted from function.in-array by hholzgra | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-115587@lists.php.net to get a copy of this message | ||
Note Submitter: com.hotmail@backglancer
----
correction to the function below, the second return is bogous
here's my tweaked version
<?PHP
function in_arrayr($needle, $haystack) {
foreach ($haystack as $value) {
if ($needle == $value) return true;
elseif (is_array($value)) in_arrayr($needle, $value);
}
return false;
}
?>