protected function findValueInMultiArray(array $path, array $reference)
    {
        // Checks path existence
        if (
            count($path) == 0
            || !isset($reference[$path[0]])
        ) {
            throw new \OutOfRangeException();
        }

        $currentElement = $reference[$path[0]];

        if (!isset($path[1])) {
            return $currentElement;
        } else if (is_array($currentElement)) {
            return $this->findValueInMultiArray(array_slice($path, 1), $currentElement);
        } else {
            throw new \OutOfRangeException();
        }
    }
protected function findValueInMultiArray(array $path, array $reference)
    {
        // Checks path existence
        if (
            count($path) == 0
            || !isset($reference[$path[0]])
        ) {
            throw new \OutOfRangeException();
        }

        $currentElement = $reference[$path[0]];

        if (!isset($path[1])) {
            return $currentElement;
        } else if (is_array($currentElement)) {
            return $this->findValueInMultiArray(array_slice($path, 1), $currentElement);
        } else {
            throw new \OutOfRangeException();
        }
    }
protected function findValueInMultiArray ( array $ path , array $ reference ) { // Checks path existence if ( count ( $ path ) == 0 || ! isset ( $ reference [ $ path [ 0 ] ] ) ) { throw new \ OutOfRangeException ( ) ; } $ currentElement = $ reference [ $ path [ 0 ] ] ; if ( ! isset ( $ path [ 1 ] ) ) { return $ currentElement ; } else if ( is_array ( $ currentElement ) ) { return $ this -> findValueInMultiArray ( array_slice ( $ path , 1 ) , $ currentElement ) ; } else { throw new \ OutOfRangeException ( ) ; } }
Find value in a multi-array

Recursively find a value in a multi-array, successively
following the different keys defined in a path.

@param array $path
@param array $reference
@return bool
@throws \OutOfRangeException
Find value in a multi - array