I do that all the time and it is very helpful.  I just kind of wonder if
there is a php function that would do it all for me.  Just got this idea
when I use the number_format() and it made me wonder about whether is there
such a function as this or not.  (Hey Jay!  Thanks for the response by the
way).

Scott F.

"Jay Blanchard" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
[snip]
    Wondering if there is any similiar function to a php
number_format().
This time, without a period.  For example, if I get a '1', I would like
to
format it to be '01' in two digit.
[/snip]

Ooh, ooh, me, me!

Make sure that the number is a string.

$number = 1;
settype($number, "string");
Test to make sure string length is 1 (becuase you don't want number like
012)

if(strlen($number)== 1){
$newNumber = "0".$number;
}

echo"$newNumber\n";



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

Reply via email to