original_string: public static function select($name, array $options, $selected = NULL, array $attributes = NULL)
      {
          $h = '';
          foreach ($options as $k => $v) {
              $a = array('value' => $k);
  
              // Is this element one of the selected options?
              if ($selected AND in_array($k, (array)$selected)) {
                  $a['selected'] = 'selected';
              }
  
              $h .= self::tag('option', $v, $a);
          }
  
          if (!$attributes) {
              $attributes = array();
          }
  
          return self::tag('select', $h, $attributes + array('name' => $name));
      }
code: public static function select($name, array $options, $selected = NULL, array $attributes = NULL)
      {
          $h = '';
          foreach ($options as $k => $v) {
              $a = array('value' => $k);
  
              // Is this element one of the selected options?
              if ($selected AND in_array($k, (array)$selected)) {
                  $a['selected'] = 'selected';
              }
  
              $h .= self::tag('option', $v, $a);
          }
  
          if (!$attributes) {
              $attributes = array();
          }
  
          return self::tag('select', $h, $attributes + array('name' => $name));
      }
code_tokens: public static function select ( $ name , array $ options , $ selected = NULL , array $ attributes = NULL ) { $ h = '' ; foreach ( $ options as $ k => $ v ) { $ a = array ( 'value' => $ k ) ; // Is this element one of the selected options? if ( $ selected AND in_array ( $ k , ( array ) $ selected ) ) { $ a [ 'selected' ] = 'selected' ; } $ h .= self :: tag ( 'option' , $ v , $ a ) ; } if ( ! $ attributes ) { $ attributes = array ( ) ; } return self :: tag ( 'select' , $ h , $ attributes + array ( 'name' => $ name ) ) ; }
docstring: Auto creates a form select dropdown from the options given .
  
  @param string $name the select element name
  @param array $options the select options
  @param mixed $selected the selected options(s)
  @param array $attributes of additional tag settings
  @return string
docstring_tokens: Auto creates a form select dropdown from the options given .