public static function has(array $array, $keyPath)
    {
        self::checkKeyPathIsValidAndNonEmpty($keyPath);
        $keys = self::explodeKeys(strval($keyPath));

        while ($keys !== array()) {
            $key = array_shift($keys);

            if (!array_key_exists($key, $array)) {
                return false;
            }
            $array = $array[$key];
            if (!is_array($array)) {
                break;
            }
        }

        return $keys === array();
    }
public static function has(array $array, $keyPath)
    {
        self::checkKeyPathIsValidAndNonEmpty($keyPath);
        $keys = self::explodeKeys(strval($keyPath));

        while ($keys !== array()) {
            $key = array_shift($keys);

            if (!array_key_exists($key, $array)) {
                return false;
            }
            $array = $array[$key];
            if (!is_array($array)) {
                break;
            }
        }

        return $keys === array();
    }
public static function has ( array $ array , $ keyPath ) { self :: checkKeyPathIsValidAndNonEmpty ( $ keyPath ) ; $ keys = self :: explodeKeys ( strval ( $ keyPath ) ) ; while ( $ keys !== array ( ) ) { $ key = array_shift ( $ keys ) ; if ( ! array_key_exists ( $ key , $ array ) ) { return false ; } $ array = $ array [ $ key ] ; if ( ! is_array ( $ array ) ) { break ; } } return $ keys === array ( ) ; }
Whether the array has the key.

@param array $array
@param string $keyPath
@return bool
Whether the array has the key .