[thelist] [PHP] Add a leading zero to a single digit integer

Tim Burgan email at timburgan.com
Wed Nov 24 21:12:13 CST 2004


Hi,


How can I add a leading zero to an integer IF its length it one digit?

eg.  8 -> 08
     9 -> 09
    10 -> 10
    11 -> 11

Is there a PHP function to do this? Or is there a function that I can
use to return the length of digits in the integer - strlen()?

I had a quick look in the manual but can't find anything..

Thanks for your time, and help would be greatly appreciated.


Tim

-- 

Tim Burgan.
Website Development & Graphic Design

E <email at timburgan.com>
W <www.timburgan.com>






More information about the thelist mailing list