<select name="start_month"> <?php global $LOC; $current_time_m = $LOC->decode_date('%m', $LOC->now); for ($i = 1; $i <= 12; $i++) { echo "<option value='$i-'"; if ($i == $current_time_m) { echo " selected='selected'"; } $month_text = date("F", mktime(0, 0, 0, $i+1, 0, 0, 0)); echo ">$month_text</option> "; } ?> </select>
You need to create an account or log in to post comments to this site.
I'm seeing a pattern, here. It may as well just be a static array, or set of constants, which you foreach through.