note 20380 added to function.date

From: Date: Tue, 02 Apr 2002 06:33:39 +0000
Subject: note 20380 added to function.date
Groups: php.notes 
Request: Send a blank email to php-notes+get-28488@lists.php.net to get a copy of this message
Nicely formated example for form SELECT field to print month names in your language using setlocale(). Just need to declare your locale settings any where before. #// e.g.: In your config file <?php setlocale("LC_TIME","es_ES"); //Spanish language locale ?> #// then: Any where you want your dropdown <SELECT name="month"> <?php for($month = 1; $month <= 12; $month++) { $monthname=ucfirst(strftime ("%B", mktime(0,0,0,$month,1,2000))); echo "<OPTION value=\"$month\">$monthname</OPTION>"; } ?> </SELECT> -- http://www.php.net/manual/en/function.date.php http://master.php.net/manage/user-notes.php?action=edit+20380 http://master.php.net/manage/user-notes.php?action=delete+20380 http://master.php.net/manage/user-notes.php?action=reject+20380

« previous php.notes (#28488) next »