function variable_format_array in Variable 7
Same name and namespace in other branches
- 6 variable.variable.inc \variable_format_array()
- 7.2 variable.variable.inc \variable_format_array()
Format array variable, handling nested arrays
1 call to variable_format_array()
- variable_form_element_array in ./
variable.form.inc - Build array form element
1 string reference to 'variable_format_array'
- variable_variable_type_info in ./
variable.variable.inc - Implements hook_variable_type_info().
File
- ./
variable.variable.inc, line 204 - Variable module hook implementations
Code
function variable_format_array($variable = NULL, $options = array()) {
if (empty($variable['value'])) {
return variable_format_empty($variable);
}
else {
$elements = array();
foreach ($variable['value'] as $item) {
$elements[] = is_array($item) ? '(' . variable_format_array(array(
'value' => $item,
), $options) . ')' : check_plain($item);
}
return implode(', ', $elements);
}
}