You are here

function mediaelement_flatten_config in MediaElement 8

Flattens nested array into a single level array.

Parameters

array $array: An array of items.

array $return: The starting point of the return values.

Return value

array The flattened array.

1 call to mediaelement_flatten_config()
mediaelement_parse_config in ./mediaelement.module
Converts module into JS config.

File

./mediaelement.module, line 138
Primary module file.

Code

function mediaelement_flatten_config($array, $return = []) {
  foreach ($array as $key => $value) {
    if (is_array($value)) {
      $return = mediaelement_flatten_config($value, $return);
    }
    else {
      $return[$key] = $value;
    }
  }
  return $return;
}