1 options.module form_options_from_text($text, $key_type, $flat = FALSE, &$duplicates = array())

Create an array representation of text option values.

If the Key of the option is within < >, treat as an optgroup

<Group 1> creates an optgroup with the label "Group 1"

<> Exits the current group, allowing items to be inserted at the root element.

File

core/modules/field/modules/options/options.module, line 567
Defines selection, check box and radio button widgets for text and numeric fields.

Code

function form_options_from_text($text, $key_type, $flat = FALSE, &$duplicates = array()) {
  module_load_include('inc', 'options', 'options.element');
  return _form_options_from_text($text, $key_type, $flat, $duplicates);
}