3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function array_search_key( $needle_key, $array ) { foreach($array AS $key=>$value){ if($key == $needle_key) return $value; if(is_array($value)){ if( ($result = array_search_key($needle_key,$value)) !== false) return $result; } } return false; } $item = ( Array ( Array( 'group_roles_name' => 'CREATOR' ) ) ); $value = "CREATOR"; if(is_array($item) && !array_search_key($value,$item)){ // not equal, break de loop $itemFound = false; echo "not found"; } else if(is_array($item) && array_search_key($value,$item)){ echo "found"; }
based on BrBTu
Output for 4.3.0 - 7.2.0
found