public static function recursiveArraySearch($needleKey, $needleValue,
                                                array $haystack)
    {
        foreach ($haystack as $key => $value) {
            $currentKey = $key;

            if (($currentKey == $needleKey && ($needleValue === null || $needleValue
                == $value)) || ( is_array($value) && self::recursiveArraySearch($needleKey,
                    $needleValue, $value) !== false)) {
                return $currentKey;
            }
        }
        return null;
    }
public static function recursiveArraySearch($needleKey, $needleValue,
                                                array $haystack)
    {
        foreach ($haystack as $key => $value) {
            $currentKey = $key;

            if (($currentKey == $needleKey && ($needleValue === null || $needleValue
                == $value)) || ( is_array($value) && self::recursiveArraySearch($needleKey,
                    $needleValue, $value) !== false)) {
                return $currentKey;
            }
        }
        return null;
    }
public static function recursiveArraySearch ( $ needleKey , $ needleValue , array $ haystack ) { foreach ( $ haystack as $ key => $ value ) { $ currentKey = $ key ; if ( ( $ currentKey == $ needleKey && ( $ needleValue === null || $ needleValue == $ value ) ) || ( is_array ( $ value ) && self :: recursiveArraySearch ( $ needleKey , $ needleValue , $ value ) !== false ) ) { return $ currentKey ; } } return null ; }
Search in array

@param mixed $needleKey
@param mixed $needleValue
@param array $haystack
@return integer
Search in array