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;
    }
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;
    }
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 ; }
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
generate html code by options array