Arr.php
public static function has(array $array, string $key, string $delimiter = null)
    {
        // Which string delimiter should we use?
        if (null === $delimiter) {
            $delimiter = static::$delimiter;
        }

        foreach (explode($delimiter, $key) as $segment) {
            if (!is_array($array) || !array_key_exists($segment, $array)) {
                return false;
            }

            $array = $array[$segment];
        }

        return true;
    }
public static function has(array $array, string $key, string $delimiter = null)
    {
        // Which string delimiter should we use?
        if (null === $delimiter) {
            $delimiter = static::$delimiter;
        }

        foreach (explode($delimiter, $key) as $segment) {
            if (!is_array($array) || !array_key_exists($segment, $array)) {
                return false;
            }

            $array = $array[$segment];
        }

        return true;
    }
public static function has ( array $ array , string $ key , string $ delimiter = null ) { // Which string delimiter should we use? if ( null === $ delimiter ) { $ delimiter = static :: $ delimiter ; } foreach ( explode ( $ delimiter , $ key ) as $ segment ) { if ( ! is_array ( $ array ) || ! array_key_exists ( $ segment , $ array ) ) { return false ; } $ array = $ array [ $ segment ] ; } return true ; }
Checks whether the given string delimited key exists in the array.

Note: Nested objects will not be accessed as if they were arrays, ie. if "some.nested.object" is an object,
not an array, then looking for "some.nested.object.key" will always return false.

@param   array   $array      The array to search in.
@param   string  $key        The string delimited key.
@param   string  $delimiter  The delimiter to use when exploding the key into parts.
@return  bool                True when the given key exists, false otherwise.
Checks whether the given string delimited key exists in the array .