public static function get(array $array, $key = null, $default = null)
    {
        if ($key === null) {
            return $array;
        }

        if (isset($array[$key])) {
            return static::value($array[$key]);
        }

        foreach (explode('.', (string) $key) as $segment) {
            if (! array_key_exists($segment, $array)) {
                return static::value($default);
            }

            $array = $array[$segment];
        }

        return $array;
    }
public static function get(array $array, $key = null, $default = null)
    {
        if ($key === null) {
            return $array;
        }

        if (isset($array[$key])) {
            return static::value($array[$key]);
        }

        foreach (explode('.', (string) $key) as $segment) {
            if (! array_key_exists($segment, $array)) {
                return static::value($default);
            }

            $array = $array[$segment];
        }

        return $array;
    }
public static function get ( array $ array , $ key = null , $ default = null ) { if ( $ key === null ) { return $ array ; } if ( isset ( $ array [ $ key ] ) ) { return static :: value ( $ array [ $ key ] ) ; } foreach ( explode ( '.' , ( string ) $ key ) as $ segment ) { if ( ! array_key_exists ( $ segment , $ array ) ) { return static :: value ( $ default ) ; } $ array = $ array [ $ segment ] ; } return $ array ; }
Get an item from an array using "dot" notation.
If key dont exist, you get a default value back.

@param array           $array
@param string|int|null $key
@param mixed           $default

@return mixed
Get an item from an array using dot notation . If key dont exist you get a default value back .