I have an array that looks something like this:
Array
(
[100] => Array
(
[room_id] => 100
[name] => Town Center
function search_key( $array, $key ) {
$results = array();
if ( is_array( $array ) ) {
if ( isset( $array[$key] ) && $array[$key] == $key )
$results[] = $array;
foreach ( $array as $subarray )
$results = array_merge( $results, tm_search_key_value( $subarray, $key ) );
}
return $results;
}
USAGE:
search_key( $array, 'pin_id');
Search specific KEY from Multidimentional, It will return array of that specific key.