original_string: public static function options2html(array $options = [], $selectedValue = null){
          // buffer prepared html codes
          $buffer = [];
          // loop options
          foreach ($options as $key => $value) {
              // make optgroup
              if(is_array($value)){
                  // turn optgroup options to html
                  $optgroupOptions = static::options2html($value, $selectedValue);
                  // append prepared group to buffer
                  $buffer[] = "<optgroup label='$key'>$optgroupOptions</options>";
              } else {
              // make option
                  // print selected='' if option value and selected value are equivalent
                  $selected = static::selected($selectedValue, $value);
                  // append prepared option to buffer
                  $buffer[] = "<option value='$value' $selected>$key</option>";
              }
          }
          // make html
          $html = implode('', $buffer);
          // return result
          return $html;
      }
code: public static function options2html(array $options = [], $selectedValue = null){
          // buffer prepared html codes
          $buffer = [];
          // loop options
          foreach ($options as $key => $value) {
              // make optgroup
              if(is_array($value)){
                  // turn optgroup options to html
                  $optgroupOptions = static::options2html($value, $selectedValue);
                  // append prepared group to buffer
                  $buffer[] = "<optgroup label='$key'>$optgroupOptions</options>";
              } else {
              // make option
                  // print selected='' if option value and selected value are equivalent
                  $selected = static::selected($selectedValue, $value);
                  // append prepared option to buffer
                  $buffer[] = "<option value='$value' $selected>$key</option>";
              }
          }
          // make html
          $html = implode('', $buffer);
          // return result
          return $html;
      }
code_tokens: public static function options2html ( array $ options = [ ] , $ selectedValue = null ) { // buffer prepared html codes
   $ buffer = [ ] ; // loop options
   foreach ( $ options as $ key => $ value ) { // make optgroup
   if ( is_array ( $ value ) ) { // turn optgroup options to html
   $ optgroupOptions = static :: options2html ( $ value , $ selectedValue ) ; // append prepared group to buffer
   $ buffer [ ] = "<optgroup label='$key'>$optgroupOptions</options>" ; } else { // make option
   // print selected='' if option value and selected value are equivalent
   $ selected = static :: selected ( $ selectedValue , $ value ) ; // append prepared option to buffer
   $ buffer [ ] = "<option value='$value' $selected>$key</option>" ; } } // make html
   $ html = implode ( '' , $ buffer ) ; // return result
   return $ html ; }
docstring: generate html code by options array
  @param array $options list of options
  @param integer|string $selectedValue for add selected='' to option attribute
  @return string generated html
docstring_tokens: generate html code by options array