note 23942 added to function.date

From: Date: Thu, 01 Aug 2002 21:37:01 +0000
Subject: note 23942 added to function.date
Groups: php.notes 
Request: Send a blank email to php-notes+get-34109@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>"; -- http://www.php.net/manual/en/function.date.php http://master.php.net/manage/user-notes.php?action=edit+23942 http://master.php.net/manage/user-notes.php?action=delete+23942 http://master.php.net/manage/user-notes.php?action=reject+23942

« previous php.notes (#34109) next »