public static function getElement(&$array, array &$keys, $value = null)
    {
        if (count($keys)) {
            $key = array_shift($keys);
            return isset($array[$key])
                ? self::getElement($array[$key], $keys, $value)
                : false;
        }

        if (!is_null($value)) {
            $array = $value;
        }

        return $array;
    }
public static function getElement(&$array, array &$keys, $value = null)
    {
        if (count($keys)) {
            $key = array_shift($keys);
            return isset($array[$key])
                ? self::getElement($array[$key], $keys, $value)
                : false;
        }

        if (!is_null($value)) {
            $array = $value;
        }

        return $array;
    }
public static function getElement ( & $ array , array & $ keys , $ value = null ) { if ( count ( $ keys ) ) { $ key = array_shift ( $ keys ) ; return isset ( $ array [ $ key ] ) ? self :: getElement ( $ array [ $ key ] , $ keys , $ value ) : false ; } if ( ! is_null ( $ value ) ) { $ array = $ value ; } return $ array ; }
Using an array of keys iterate through the array following the
keys to find the final key value. If a value is passed then set
that value.

@param array &$array  The array to be used.
@param array &$keys   The key path to follow as an array.
@param array $value   If set the target element will have this value set
to it.

@return mixed  The final value of the key path.
Using an array of keys iterate through the array following the keys to find the final key value . If a value is passed then set that value .