note 58517 deleted from function.array-unshift by danbrown
| From: | danbrown@php.net | Date: | Wed, 12 Aug 2009 16:40:42 +0000 |
| Subject: | note 58517 deleted from function.array-unshift by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-159382@lists.php.net to get a copy of this message | ||
Note Submitter:
----
function multi_array_search($search_value, $the_array)
{
if (is_array($the_array))
{
foreach ($the_array as $key => $value)
{
$result = multi_array_search($search_value, $value);
if (is_array($result))
{
$return = $result;
array_unshift($return, $key);
return $return;
}
elseif ($result == true)
{
$return[] = $key;
return $return;
}
}
return false;
}
else
{
if ($search_value == $the_array)
{
return true;
}
else return false;
}
}