note 71129 deleted from function.array-search by levim
| From: | levim@php.net | Date: | Mon, 24 Feb 2014 22:41:08 +0000 |
| Subject: | note 71129 deleted from function.array-search by levim | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-198648@lists.php.net to get a copy of this message | ||
Note Submitter: evert_18 at hotmail dot com
----
This function can search in multidimensional arrays, no mather how multidimensional the array is!
<?php
function array_search(&$array,$needle)
{
foreach($array as $key => $value)
{
if($value == $needle || $key == $needle)
return(true);
else
if(is_array($value))
$this->search($value,$needle);
else
return(false);
}
}
?>