title: Default Value in PHP For Loop
body: <p>I have a HTML select form to select the day/month/year, and this is generated with PHP.  My for loop, for example with the month, looks like this:</p>
  
  <pre><code>$html="&lt;select name=\"".$name."month\"&gt;";       
  for($i=1;$i&lt;=12;$i++)
   {$html.="&lt;option value='$i'&gt;$months[$i]&lt;/option&gt;";}
  $html.="&lt;/select&gt; ";
  </code></pre>
  
  <p>I can't seem to figure out how to set a "default" value to the current month while retaining all of the prior months in the dropdown (I can just set $i=date("n"), but then I lose the ability to select any prior month).</p>
  
  <p>Does anybody know a simple way of setting the default value to be the current day?  Thank you very much!</p>