note 12423 deleted from function.getdate by tomsommer

From: Date: Wed, 15 Sep 2004 16:37:36 +0000
Subject: note 12423 deleted from function.getdate by tomsommer
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-76754@lists.php.net to get a copy of this message
Note Submitter: tron at mailzone dot com ---- Here is a nice little function to generate a listbox of months for use in a scheduling system! <?php function fncMonthSelection() { $today = getdate(); $thismonth = $today["mon"]; $nameofselectbox = "month"; print "<select name = \"$nameofselectbox\">\n"; for ($x=$thismonth;$x<13;$x++){ print "<option value='" . date("m", mktime (0,0,0,$x,1,0)) . "'>" . date ("F", mktime(0,0,0,$x,1,0)) . "</option>\n"; } print "</select>\n"; return; } ?> <html> <head> <title>Example Listbox</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#FFFFFF"> <form name="form1"> <?php fncMonthSelection(); ?> </form> </body> </html>

« previous php.notes (#76754) next »