Re: [PHP] Outputting a 2 digit number < 10

2001-01-29 Thread Brian White
I normally solve this problem by doing a "< 10" test, on the assumption it is quicker. Something like for ($i=00;$i<$daysinmonth;$i++) { $str_i= (string) $i; if ( $i < 10 ) { $str_i = "0$str_i"; } if ($i == $day) { echo("$str_i\n"); } e

Re: [PHP] Outputting a 2 digit number < 10

2001-01-25 Thread Pavel Jartsev
Jamie wrote: > > ... > > "; > $day = (date ("d")); > $daysinmonth = (date("t")); > for ($i=00;$i<$daysinmonth;$i++){ > if ($i == $day) { >echo("$i\n"); > } else { > echo("$i\n"); >} > } >

[PHP] Outputting a 2 digit number < 10

2001-01-25 Thread Jamie
I need to enable a user to insert an 'NEWS' item into a mySQL table one of the definable limits for the user is to be the date that the news is to be displayed. Currently the collum is in a 'date' format and should be stored in a MMDD - being Australian we are used to the exact reverse of that