src/Collection/NestedArray.php
public static function get(array $nested, $key, $delimiter='.')
    {

        if (is_null($key)) return $nested;

        if (isset($nested[$key])) return $nested[$key];

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

            $nested = $nested[$segment];
        }

        return $nested;
    }
public static function get(array $nested, $key, $delimiter='.')
    {

        if (is_null($key)) return $nested;

        if (isset($nested[$key])) return $nested[$key];

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

            $nested = $nested[$segment];
        }

        return $nested;
    }
public static function get ( array $ nested , $ key , $ delimiter = '.' ) { if ( is_null ( $ key ) ) return $ nested ; if ( isset ( $ nested [ $ key ] ) ) return $ nested [ $ key ] ; foreach ( explode ( $ delimiter , $ key ) as $ segment ) { if ( ! is_array ( $ nested ) || ! array_key_exists ( $ segment , $ nested ) ) { return ; } $ nested = $ nested [ $ segment ] ; } return $ nested ; }
Get a key from a nested array. Query a deeply nested array with
property.child.name

@param array $nested
@param string $key
@param string $delimiter
Get a key from a nested array . Query a deeply nested array with property . child . name