public static function keyExists(array $array, $path) : bool
    {
        foreach (explode('.', $path) as $segment) {
            if (! is_array($array) or ! array_key_exists($segment, $array)) {
                return false;
            }

            $array = $array[$segment];
        }

        return true;
    }
public static function keyExists(array $array, $path) : bool
    {
        foreach (explode('.', $path) as $segment) {
            if (! is_array($array) or ! array_key_exists($segment, $array)) {
                return false;
            }

            $array = $array[$segment];
        }

        return true;
    }
public static function keyExists ( array $ array , $ path ) : bool { foreach ( explode ( '.' , $ path ) as $ segment ) { if ( ! is_array ( $ array ) or ! array_key_exists ( $ segment , $ array ) ) { return false ; } $ array = $ array [ $ segment ] ; } return true ; }
Checks if the given dot-notated key exists in the array.

if (Arr::keyExists($array, 'foo.bar')) {
// Do something...
}

@param  array   $array The search array
@param  mixed   $path  Array path
@return bool
Checks if the given dot - notated key exists in the array .