note 14257 deleted from function.getdate by tomsommer

From: Date: Wed, 15 Sep 2004 16:37:26 +0000
Subject: note 14257 deleted from function.getdate by tomsommer
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-76753@lists.php.net to get a copy of this message
Note Submitter: stu at ekins dot net ---- Tron@mailzone did something to produce a list box of the remaining months of the year. Thanks for that, was most useful. Here's a slight mod that shows 12 months from the current month. $today = getdate(); $thismonth = $today["mon"]; $nameofselectbox = "month"; print "<select name = \"$nameofselectbox\">\n"; for ($x=$thismonth;$x<$thismonth+12;$x++){ if($x<12) { $y=$x; } else { $y=$x-12; } print "<option value='" . date("m", mktime (0,0,0,$y,1,0)) . "'>" . date ("F", mktime(0,0,0,$y,1,0)) . "</option>\n"; }

« previous php.notes (#76753) next »