I have a multi-dimensional array:
$categories = array(
array(
\'CategoryID\' => 14308,
\'CategoryLevel\' => 1,
\'CategoryNa
You are ignoring the returned value of your inner call to recursive_array_search. Don't do that.
/*
* Searches for $needle in the multidimensional array $haystack.
*
* @param mixed $needle The item to search for
* @param array $haystack The array to search
* @return array|bool The indices of $needle in $haystack across the
* various dimensions. FALSE if $needle was not found.
*/
function recursive_array_search($needle,$haystack) {
foreach($haystack as $key=>$value) {
if($needle===$value) {
return array($key);
} else if (is_array($value) && $subkey = recursive_array_search($needle,$value)) {
array_unshift($subkey, $key);
return $subkey;
}
}
}