classes/Structure.php
public static function fetch($path, $root) {
      $_ = (array)$root;
      if (strpos($path,'.') === false) {
        return isset($_[$path]) ? $_[$path] : null;
      } else {
        list($frag,$rest) = explode('.', $path, 2);
        if ($rest) {
          return isset($_[$frag]) ? self::fetch($rest, $_[$frag]) : null;
        } elseif ($frag) {
          return (array)$_[$frag];
        } else {
          return null;
        }
      }
    }
public static function fetch($path, $root) {
      $_ = (array)$root;
      if (strpos($path,'.') === false) {
        return isset($_[$path]) ? $_[$path] : null;
      } else {
        list($frag,$rest) = explode('.', $path, 2);
        if ($rest) {
          return isset($_[$frag]) ? self::fetch($rest, $_[$frag]) : null;
        } elseif ($frag) {
          return (array)$_[$frag];
        } else {
          return null;
        }
      }
    }
public static function fetch ( $ path , $ root ) { $ _ = ( array ) $ root ; if ( strpos ( $ path , '.' ) === false ) { return isset ( $ _ [ $ path ] ) ? $ _ [ $ path ] : null ; } else { list ( $ frag , $ rest ) = explode ( '.' , $ path , 2 ) ; if ( $ rest ) { return isset ( $ _ [ $ frag ] ) ? self :: fetch ( $ rest , $ _ [ $ frag ] ) : null ; } elseif ( $ frag ) { return ( array ) $ _ [ $ frag ] ; } else { return null ; } } }
Dot-Notation Array Path Resolver
@param  string $path The dot-notation path
@param  array $root The array to navigate
@return mixed The pointed value
Dot - Notation Array Path Resolver