Re: Splitting a string

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

 



Børge Holen wrote:
Oh this was good.
I added a while loop to insert extra strings "0" in front of the number to add if the string is less than 5 chars short.

sprintf is your friend here, no need to use a loop.

sprintf('%05d', '1234');

--
Postgresql & php tutorials
http://www.designmagick.com/

--
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