strings as numbers
Posted: Wed Feb 05, 2003 4:10 pm
I'm wondering if there's a way to force an incremented value to come out as two digits. I tried making it a string, like so:
but no luck, only the first value is two digits (and those greater than 9, obvioiusly). Anybody have any ideas as to how I could accomplish this?
Code: Select all
<?php
for ($zz = "01"; $zz <= 31; $zz++)
{
echo "<OPTION VALUE="" . $zz . "">" . $zz . "</OPTION>";
}
?>