1 options.module options_array_flatten($array)

Flattens an array of allowed values.

Parameters

$array: A single or multidimensional array.

Return value

A flattened array.:

File

core/modules/field/modules/options/options.module, line 387
Defines selection, check box and radio button widgets for text and numeric fields.

Code

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