You are here

function webform_count_terminals in Webform 7.4

Counts terminals in an array.

Useful for counting how many input_vars were returned in $_POST.

Parameters

$a: Array or array element to be counted

Return value

int Number of non-array elements within $a.

1 call to webform_count_terminals()
webform_input_vars_check in ./webform.module
Check if the last form submission exceeded the servers max_input_vars limit.

File

./webform.module, line 5589
This module provides a simple way to create forms and questionnaires.

Code

function webform_count_terminals($a) {
  return is_array($a) ? array_reduce($a, function ($carry, $item) {
    return $carry + webform_count_terminals($item);
  }, 0) : 1;
}