public static function getPath($data, $path)
    {
        $path = explode('/', $path);

        while (null !== ($part = array_shift($path))) {
            if (!is_array($data) || !isset($data[$part])) {
                return null;
            }
            $data = $data[$part];
        }

        return $data;
    }
public static function getPath($data, $path)
    {
        $path = explode('/', $path);

        while (null !== ($part = array_shift($path))) {
            if (!is_array($data) || !isset($data[$part])) {
                return null;
            }
            $data = $data[$part];
        }

        return $data;
    }
public static function getPath ( $ data , $ path ) { $ path = explode ( '/' , $ path ) ; while ( null !== ( $ part = array_shift ( $ path ) ) ) { if ( ! is_array ( $ data ) || ! isset ( $ data [ $ part ] ) ) { return null ; } $ data = $ data [ $ part ] ; } return $ data ; }
Gets a value from an array using a path syntax to retrieve nested data.

This method does not allow for keys that contain "/". You must traverse
the array manually or using something more advanced like JMESPath to
work with keys that contain "/".

// Get the bar key of a set of nested arrays.
// This is equivalent to $collection['foo']['baz']['bar'] but won't
// throw warnings for missing keys.
GuzzleHttp1\get_path($data, 'foo/baz/bar');

@param array  $data Data to retrieve values from
@param string $path Path to traverse and retrieve a value from

@return mixed|null
Gets a value from an array using a path syntax to retrieve nested data .