Code: Select all
// --- build default list ----------
$select_list = "<select name='type' id='type'>";
for($x = 0; $x < count($select); $x++)
{
if($x == 0)
{
$select_list .= "<option value='$select[$x]' selected>$select[$x]</option>";
} else {
$select_list .= "<option value='$select[$x]'>$select[$x]</option>";
}
}
$select_list .= "</select>";
But I'm not sure how to incorporate this into my php. Any pointers would be much appreciated.