PHP: display leading zero
by =?iso-8859-4?B?TGF1cmkgVuRpbg==?= <optima(at)hot.ee>
|
Date: |
Mon, 2 Oct 2000 20:10:54 +0300 |
To: |
<hwg-languages(at)hwg.org> |
|
todo: View
Thread,
Original
|
|
Hello everybody,
I'd like to list the numbers 01-31 to a drop down list(select box).
The code I'm using:
//////////////////////// snip
<SELECT name="kuup2ev">
<OPTION value="<?$kuup2ev = 01; echo $kuup2ev;?>" selected>
<?echo $kuup2ev;?>
</OPTION>
<? $date_select = $kuup2ev; while($date_select < 32) { ?>
<OPTION value="<?echo $date_select; ?>"><?echo $date_select;?></OPTION>
<? $date_select++; } ?>
</SELECT>
//////////////////////// snip
Now, instead of:
01
02
03
04
...
I get:
1
2
3
4
...
The question: How can I make PHP display the leading zero in case the number is
only one digit?
Thanks,
Lauri
HWG: hwg-languages mailing list archives,
maintained by Webmasters @ IWA