note 23942 deleted from function.date by dams
| From: | dams@php.net | Date: | Sat, 03 Aug 2002 03:06:14 +0000 |
| Subject: | note 23942 deleted from function.date by dams | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-34183@lists.php.net to get a copy of this message | ||
I've noticed a lot of scripts and people who use an array for month names, even though PHP has
it built right in.
This will output a dropdown box with month names in it and the month numbers in the values.
echo "<select name='months'>\n";
for ($i=1; $i <= 12; $i++) {
$date = strtotime("$i/1/2000");
echo "<option value='$i'>";
echo date("M",$date);
echo "</option>\n";
}
echo "</select>";