original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: 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.
docstring_tokens: This is used with menus for getting to the bottom of multi - dimensional arrays and determining it s root keys and values .