You are here

function _webform_validation_flatten_array in Webform Validation 7

Same name and namespace in other branches
  1. 6 webform_validation.validators.inc \_webform_validation_flatten_array()

Helper function to deal with submitted values that are arrays.

For example, multiple select component. We flatten the array as a comma-separated list to do the comparison.

2 calls to _webform_validation_flatten_array()
webform_validation_webform_validation_validate in ./webform_validation.validators.inc
Implements hook_webform_validation_validate().
_webform_validation_count_words in ./webform_validation.validators.inc
Count the number of words in a value.

File

./webform_validation.validators.inc, line 1054
Provides validation functionality and hooks.

Code

function _webform_validation_flatten_array($val) {
  if (is_array($val)) {
    $arr = array_filter($val, '_webform_validation_check_false');
    return implode(',', $arr);
  }
  return $val;
}