function form_options_flatten

7.x form.inc form_options_flatten($array)
5.x form.inc form_options_flatten($array, $reset = TRUE)
6.x form.inc form_options_flatten($array, $reset = TRUE)
8.x form.inc form_options_flatten($array)

Allows PHP array processing of multiple select options with the same value.

Used for form select elements which need to validate HTML option groups and multiple options which may return the same value. Associative PHP arrays cannot handle these structures, since they share a common key.

Parameters

$array: The form options array to process.

Return value

An array with all hierarchical elements flattened to a single array.

Related topics

3 calls to form_options_flatten()
node_filter_form_submit in drupal/modules/node/node.admin.inc
Form submission handler for node_filter_form().
user_filter_form_submit in drupal/modules/user/user.admin.inc
Process result from user administration filter form.
_form_validate in drupal/includes/form.inc
Performs validation on form elements.

File

drupal/includes/form.inc, line 2583
Functions for form and batch generation and processing.

Code

function form_options_flatten($array) {
  // Always reset static var when first entering the recursion.
  drupal_static_reset('_form_options_flatten');
  return _form_options_flatten($array);
}