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
Jamie wrote:
>
> ...
>
> ";
> $day = (date ("d"));
> $daysinmonth = (date("t"));
> for ($i=00;$i<$daysinmonth;$i++){
> if ($i == $day) {
>echo("$i\n");
> } else {
> echo("$i\n");
>}
> }
>
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
3 matches
Mail list logo