$d = 5;
$dd = sprintf("%0d", $d);
will do -- $dd = "05";

----- Original Message ----- 
From: "Diana Castillo" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, October 10, 2003 10:44 AM
Subject: [PHP] pad numbers


> is there a function to convert a number that has less than two digits into
a
> number with a leading zero?
> for instance, to convert a "5" to "05" but to leave a "11" as "11"
> thanks,
> Diana
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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

Reply via email to