Re: list of Months

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

 



Well, looks like the idea is alway the same, with some (very usefull)
variations.

Thanks for help!

Afan



> afan@xxxxxxxx wrote:
>> Hi,
>> to create a list of all months in drop-down menu I use this code:
>>
>> <?php
>> $month_names = array(1=>'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul',
>> 'Aug', 'Sep', 'Oct', 'Nov', 'Dec');
>> ?>
>>
>> <select name="QuoteMonth">
>> <option value=""></option>
>> <?php
>> for($i=1; $i<=12; $i++)
>> {
>>  if(date('m') == $i) $selected_QuoteMonth = 'SELECTED';
>>  else $selected_QuoteMonth = '';
>>  echo "<option value=$i $selected_QuoteMonth> $i </option>";
>> }
>> ?>
>> </select>
>
> What about dumping the $month_names array and using strftime()?
>

-- 
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