You are here

function _webform_validation_flatten_array in Webform Validation 6

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

Helper function to deal with submitted values that are arrays (e.g. multiple select component) We flatten the array as a comma-separated list to do the comparison.

1 call to _webform_validation_flatten_array()
webform_validation_webform_validation_validate in ./webform_validation.validators.inc
Implementation of hook_webform_validation_validate().

File

./webform_validation.validators.inc, line 522
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;
}