note 38873 deleted from function.in-array by didou
| From: | didou@php.net | Date: | Fri, 09 Jan 2004 17:12:50 +0000 |
| Subject: | note 38873 deleted from function.in-array by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-63217@lists.php.net to get a copy of this message | ||
Note Submitter: php.in_array@cja.org.uk
----
"duerra at nospam dot yahoo dot com"'s function looked really useful but doesn't
actually work. I've corrected it here.
function in_multi_assoc_array($search, $array, $key)
{
foreach($array AS $tmpkey=>$tmpvalue)
{
if($tmpkey == $key)
if($tmpvalue == $search)
return true;
if(is_array($tmpvalue))
if (in_multi_assoc_array($search, $tmpvalue, $key))
return true;
}
return false;
}