note 14257 added to function.getdate.php
| From: | stu at ekins dot net | Date: | Tue, 24 Jul 2001 12:03:42 +0000 |
| Subject: | note 14257 added to function.getdate.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-15762@lists.php.net to get a copy of this message | ||
Tron@mailzone did something to produce a list box of the remaining months of the year. Thanks for
that, was most useful.<p> Here's a slight mod that shows 12 months from the current
month. <p>
$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";
}
http://www.php.net/manual/en/function.getdate.php