Add characters to month loop?
- by JM4
I currently have a php loop running exactly how I need it with proper validations (in both php and javascript) with one exception, if the month is less than 2 digits, (i.e. 1,2,3,4), I need for a '0' to appear before:
01 - January
02 - February
...
10 - October
My code for the loop is currently:
<select name="Month">
<option value="">Month</option>
<?php
for ($i=1; $i<=12; $i++)
{
echo "<option value='$i'";
if ($fields["Month"] == $i)
echo " selected";
echo ">$i</option>";
}
?>
</select>
any ideas?
Also note, this month date is being stored in session, not interested in printing to screen