Re: list of Months

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 01 Oct 2004 10:30:19 +0200, Marek Kilimajer <lists@xxxxxxxxxxxxx> wrote:
> What about dumping the $month_names array and using strftime()?

Interesting -- more portable since the month names would then follow
locale settings.

Plus it paves the way for a really hairy one-liner. With apologies to
the original poster for the drift and the perversity of this example:

<?php
print"<select name='QuoteMonth'>".implode("\n",array_map(create_function('$n','return"<option
value=\"$n\"".(date("n")==$n?"
selected=\"selected\"":"").">".strftime("%b",strtotime("2004-$n-01"))."</option>";'),range(1,12)))."</select>";
?>



-- 
paul bissex, e-scribe.com -- database-driven web development
413.585.8095
69.55.225.29
01061-0847
72°39'71"W 42°19'42"N

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux