How do you make a select date menu using the current month until the end of the year?
For example… if displayed the drop down today it would show September to December only as options to the user.
This is the code I have so far but it shows months prior to September as well.
<?php
$curr_month = date("m");
$month = array (1=>"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
$select = "<select name=\"month\">\n";
foreach ($month as $key => $val) {
$select .= "\t<option val=\"".$key."\"";
if ($key == $curr_month) {
$select .= " selected=\"selected\">".$val."</option>\n";
} else {
$select .= ">".$val."</option>\n";
}
}
$select .= "</select>";
echo $select;
?>
Just use array_slice