Re: Padding number with zeros

From: Date: Sat, 16 Dec 2000 10:44:27 +0000
Subject: Re: Padding number with zeros
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-30656@lists.php.net to get a copy of this message
Hello Marcio, (MG == "Marcio Ghiraldelli") marcio@adapta.com.br writes: MG> How do I pad a number to a given number of zeros? MG> ie.: MG> 25 to 0025 <?php printf("%04d", 25); ?> MG> 134 to 0134 MG> 1 to 0001 MG> ? http://www.php.net/manual/html/function.printf.html http://www.php.net/manual/html/function.sprintf.html -Brian -- Keyboard: Instrument used to enter errors into computer.

« previous php.general (#30656) next »