Example #1
0
 /**
  * Flatten a multi-dimensional associative array with dots.
  *
  * @param array $config
  * @param string $prepend
  * @return array
  */
 public static function flatten(array $config, $prepend = '')
 {
     $results = array();
     foreach ($config as $key => $value) {
         if (is_array($value)) {
             $results = array_merge($results, Config::flatten($value, $prepend . $key . '.'));
         } else {
             $results[$prepend . $key] = $value;
         }
     }
     return $results;
 }