1 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.


$array: The form options array to process.

Return value

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

Related topics


core/includes/form.inc, line 2708
Functions for form and batch generation and processing.


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