Flattens an array of allowed values.
$array: A single or multidimensional array.
A flattened array.
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;
}