note 19049 added to function.date

From: Date: Wed, 13 Feb 2002 23:47:27 +0000
Subject: note 19049 added to function.date
Groups: php.notes 
Request: Send a blank email to php-notes+get-26595@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. -- http://www.php.net/manual/en/function.date.php http://master.php.net/manage/user-notes.php?action=edit+19049 http://master.php.net/manage/user-notes.php?action=delete+19049 http://master.php.net/manage/user-notes.php?action=reject+19049

« previous php.notes (#26595) next »