Return to Snippet

Revision: 48153
at June 25, 2011 01:38 by jurius


Updated Code
function searchArrayValueByKey(array $array, $search) {
	foreach (new RecursiveIteratorIterator(new RecursiveArrayIterator($array)) as $key => $value) {
	    if ($search === $key)
		return $value;
	}
	return false;
    }

Revision: 48152
at June 25, 2011 01:37 by jurius


Initial Code
function searchArrayValueByKey(array $array, $search) {

	foreach (new RecursiveIteratorIterator(new RecursiveArrayIterator($array)) as $key => $value) {
	    if ($search === $key)
		return $value;
	}
	return false;
    }

Initial URL

                                

Initial Description

                                

Initial Title
Search value by key in multidimensional array

Initial Tags
search, array

Initial Language
PHP