note 63151 deleted from function.in-array by bjori
| From: | bjori@php.net | Date: | Tue, 14 Mar 2006 19:02:55 +0000 |
| Subject: | note 63151 deleted from function.in-array by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-105804@lists.php.net to get a copy of this message | ||
Note Submitter: santi oliveras
Reason: useless
----
This recursive search works well. I've tested some ones before and didn't work for me.
This also checks that the types are the same.
function in_arrayr($needle, $haystack){
foreach ($haystack as $v){
if (is_array($v)){
if(in_arrayr($needle, $v))
return true;
}
elseif($needle === $v) return true;
}
return false;
}