You are here

function trim_value in Trim 8

Trim string values and recursively trim array values.

Parameters

mixed &$value: A string, integer, array, or object of the value.

1 call to trim_value()
trim_form_values in ./trim.module
Validation callback function. Trim the values of the form.

File

./trim.module, line 42
Trim module.

Code

function trim_value(&$value) {
  if (is_array($value)) {
    foreach ($value as &$value2) {
      trim_value($value2);
    }
  }
  elseif (is_string($value)) {
    $value = trim($value);
  }
}