note 19049 deleted from function.date by hholzgra
| From: | hholzgra@php.net | Date: | Sat, 13 Apr 2002 20:00:54 +0000 |
| Subject: | note 19049 deleted from function.date by hholzgra | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-29238@lists.php.net to get a copy of this message | ||
You can easily write a form select field with the names of months, without creating an array with
the month-names:
---------------------------
<SELECT name="month">
<? for($month = 1; $month <= 12; $month++) {
$monthname = date("F", mktime(0,0,0,$month,1,2000));
echo "<OPTION value=$month>$monthname</OPTION>";
}
?>
</SELECT>
---------------------------
You can use strftime("%B",...) with setlocal() to print names in other languages.