function trim_array_values in Trim 7
Trim all the values of the provided array, and those in all nested arrays.
Parameters
array $array: An array of values.
1 call to trim_array_values()
- trim_form_values in ./
trim.module - Validation callback function. Trim the values of the form.
File
- ./
trim.module, line 32
Code
function trim_array_values(&$array) {
foreach ($array as &$value) {
if (is_string($value)) {
$value = trim($value);
}
elseif (is_array($value)) {
trim_array_values($value);
}
}
}