Re: Problem with a while loop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> The following script would look like this when run
> 00001
> 2
> 3
> 4
> I needed it to look like this
> 00001
> 00002
> 00003

You're going to want to use printf or sprintf to format the numbers.

example: printf( "%05d", $i ); 

this would print out your number, then left fill it will the zeros you want.

-Dan Joseph

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux