function views_system_convert_nested_array_into_flat_array in Views System 7.4
Helper function to convert a nested array into a flat array.
1 call to views_system_convert_nested_array_into_flat_array()
- views_handler_field_views_system_settings::pre_render in views/
views_handler_field_views_system_settings.inc - Run before any fields are rendered.
File
- ./
views_system.module, line 287 - Extends the Views module and provides fields, filter criteria, and sort criteria for Modules/Themes/Theme engines.
Code
function views_system_convert_nested_array_into_flat_array($nested, $path = NULL, $delimiter = '.') {
$flat = array();
if (!is_null($path)) {
$path .= $delimiter;
}
if (is_array($nested)) {
foreach ($nested as $key => &$value) {
if (is_array($value)) {
$flat = array_merge($flat, views_system_convert_nested_array_into_flat_array($value, $path . $key, $delimiter));
}
else {
$flat[$path . $key] = $value;
}
}
}
return $flat;
}