title: PHP display 01 instead of 1
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1699958/formatting-a-number-with-leading-zeros-in-php">Formatting a number with leading zeros in PHP</a>  </p>
  </blockquote>
  
  
  
  <p>I am populating a select box with php.</p>
  
  <p>This is the code:</p>
  
  <pre><code>$select_month_control = '&lt;select name="month" id="month"&gt;';
  for($x = 1; $x &lt;= 12; $x++) {
  $select_month_control.= '&lt;option value="'.$x.'"'.($x != $month ? '' : ' selected="selected"').'&gt;'.date('F',mktime(0,0,0,$x,1,$year)).'&lt;/option&gt;';
  }
  $select_month_control.= '&lt;/select&gt;';
  </code></pre>
  
  <p>This is creating this:</p>
  
  <pre><code>&lt;select id="month" name="month"&gt;
  &lt;option value="1"&gt;January&lt;/option&gt;
  &lt;option value="2"&gt;February&lt;/option&gt;
  &lt;option value="3"&gt;March&lt;/option&gt;
  &lt;option value="4"&gt;April&lt;/option&gt;
  &lt;option value="5"&gt;May&lt;/option&gt;
  &lt;option value="6"&gt;June&lt;/option&gt;
  &lt;option value="7"&gt;July&lt;/option&gt;
  &lt;option value="8"&gt;August&lt;/option&gt;
  &lt;option selected="selected" value="9"&gt;September&lt;/option&gt;
  &lt;option value="10"&gt;October&lt;/option&gt;
  &lt;option value="11"&gt;November&lt;/option&gt;
  &lt;option value="12"&gt;December&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>The problem is that I need the 1, 2, 3 etc to be 01, 02, 03 etc... Like this:</p>
  
  <pre><code>&lt;option value="01"&gt;January&lt;/option&gt;
  </code></pre>
  
  <p>instead of: </p>
  
  <pre><code>&lt;option value="1"&gt;January&lt;/option&gt;
  </code></pre>
  
  <p>How can I do this?</p>