If you have some sites that do not rely on a framework you could use this function to generate a simple HTML select.
Note: It won't preselect multiple values.
You can download the the code from the link below (usually doesn't look good in a post)

gethtmlselectphp

[code language="php"]
//echo getHTMLSelect('dropdown', array(0 => "", 1 => "'test'"", 2 => "test2"), @$_REQUEST['sel']);

/**
* Returns an HTML dropdown menu.
*
* @param string $name HTML select name
* @param array $values options key value
* @param int $selected_id currently selected ID
* @param string $attr several attributes that will be added in









$buff .= "n";
return $buff;
}
[/code]

Referral Note: When you purchase through an referral link (if any) on this page, we may earn a commission.
If you're feeling thankful, you can buy me a coffee or a beer