private function flatten(array $array)
    {
        $single = array();
        if (isset($array['hier'])) {
            unset($array['hier']);
        }
        foreach ($array as $key => $value) {
            if (is_array($value)) {
                foreach ($this->flatten($value) as $key => $value) {
                    $single[$key] = $value;
                }
            } else {
                $single[$key] = $value;
            }
        }

        return $single;
    }
private function flatten(array $array)
    {
        $single = array();
        if (isset($array['hier'])) {
            unset($array['hier']);
        }
        foreach ($array as $key => $value) {
            if (is_array($value)) {
                foreach ($this->flatten($value) as $key => $value) {
                    $single[$key] = $value;
                }
            } else {
                $single[$key] = $value;
            }
        }

        return $single;
    }
private function flatten ( array $ array ) { $ single = array ( ) ; if ( isset ( $ array [ 'hier' ] ) ) { unset ( $ array [ 'hier' ] ) ; } foreach ( $ array as $ key => $ value ) { if ( is_array ( $ value ) ) { foreach ( $ this -> flatten ( $ value ) as $ key => $ value ) { $ single [ $ key ] = $ value ; } } else { $ single [ $ key ] = $ value ; } } return $ single ; }
This is used with menus for getting to the bottom of multi-dimensional arrays, and determining it's root keys and values.

@param array $array

@return array A single-dimensional ``array($key => $value, ...)``'s.
This is used with menus for getting to the bottom of multi - dimensional arrays and determining it s root keys and values .