Mesut Tunga wrote:
> 
> Hi All,
> 
> a for statment like below has been worked lowe php versions:
> 
>   for ( $idx = "01"; $idx <= 12; $idx++ )
>   {
>    echo " <option value=\"$idx\">$idx\n";
>   }
> 
> like 01, 02, 03, 04, ... 12
> 
> but same statment on 4.0.6 version, it writes
> 
> 01, 2, 3, 4,  ... 12
> 
> what is the different between verisons? or how can I solve this?
> 

Try this:
<?
for ( $idx = 1; $idx <= 12; $idx++ )
{
  printf( " <option value=\"%02d\">\n",$idx );
}
?>

See also:
http://www.php.net/manual/en/function.printf.php
http://www.php.net/manual/en/function.sprintf.php

-- 
Pavel a.k.a. Papi

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to