You can do it: <? $month=array("Febrey",.....); echo "<select name=\"nameofyourtag\">" for ($i=1;$i<13;$i++) { echo "<option value=\"$i\">$month[$i]"; } echo </select> --- [EMAIL PROTECTED] 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> > > Is there any better way? > > Thanks for any help. > > Afan > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > ===== ---------DIGITAL SIGNATURE------------------- ///Mohsen Pahlevanzadeh//////// Network administrator & programmer My home phone is: +98213810146 My email address is m_pahlevanzadeh at yahoo dot com My website is: http://webnegar.net ---------------------------------------------------------------- __________________________________ Do you Yahoo!? Yahoo! Mail - 50x more storage than other providers! http://promotions.yahoo.com/new_mail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php