This function builds an option list for selecting a month:
function hs_select_month($name,$def = 0)
{
global $now;
if ($def == 0) $def = date('n',$now);
$months = array(
'Jan','Feb','Mar','Apr','May','Jun',
'Jul','Aug','Sep','Oct','Nov','Dec');
$str = '<select name="' . $name . '">' . NL;
/* Cycle through */
$id = 1;
foreach($months as $month)
{
if ($id == $def) $sel = 1;
else $sel = 0;
$str .= hs_option($id++,$month,$sel);
}
/* Finish Up */
$str .= '</select>' . NL;
return $str;
}
Basically, just keep concatenating data on to the end of $str and then return it.