Adding a 0 in front of date error

juliocobra

New Member
I want to add 0's in front of the single digit numbers.\[code\]for($i_y=1950; $i<=2012; $i++) $years[]=$i_y;for($i_m=1; $i<=12; $i++) $months[]=$i_m;for($i_d=1; $i<=31; $i++) $days[]=$i_d;\[/code\]tried\[code\]for($i_y=1950; $i<=2012; $i++) $years[]=$i_y;for($i_m=01; $i<=12; $i++) $months[]=$i_m;for($i_d=01; $i<=31; $i++) $days[]=$i_d;\[/code\]it wasn't that simple, whats the correct way?it's for a select optionsExample\[code\]for($i=1; $i<=50; $i++)$months=$i;echo '<select name="month" select id="month">';echo '<option value="">' . __("0" ) . '</option>';foreach($months as $month){$selected = '';echo '<option value="' . $month . '" ' . $selected . '>' . $month . '</option>'; }echo '</select>';\[/code\]
 
Top