12
arraysearchassoc
array_search_assoc
SYNOPSIS
array_search_assoc($array, $key, $value, $path=null)
DESCRIPTION
EXEMPLE
CODE
- function array_search_assoc($array, $key, $value, $path=null) {
- if (array_key_exists($key, $array) && $array[$key] == $value) {
- $path[]=$key;
- return $path;
- }
- foreach ($array as $k => $v ) {
- if (is_array($v)) {
- $path[]=$k;
- $p = array_search_assoc($v, $key, $value, $path);
- if ($p !== false) {
- return $p;
- }
- }
- }
- return false;
- }
Comments