Library code snippets
Output number with leading zeros
By altphpfaq, published on 17 Oct 2001
Here's simple example using the printf function to output a number
with leading zeros.
<?
$number = 15;
printf("%05d", $number);
?>
Related articles
Related discussion
-
Ventrilo Server Status Php. Snmp Server Enable Traps
by MarkHewitt (0 replies)
-
Aion Server Status Php, Server Racks Cabinets
by MarkHewitt (0 replies)
-
Moparscape Server Status Php - Global Catalog Server Could Not Be Located
by MarkHewitt (0 replies)
-
accutane online without prescription, isotretinoin online, accutane cost, accutane acne treatment
by torgo (0 replies)
-
We are seeking a highly skilled iPhone Develope
by Kim abunado (0 replies)
Related podcasts
-
EarthClassMail.com - Moving from LAMP to .NET 3.5
Scott chats with Matt Davis, architect at EarthClassMail.com, about their move from a LAMP stack (Linux/Apache/mysql/PHP) to .NET 3.5. What's working, what's not, and what kinds of issues are they running into as their architect their solution.
Events coming up
-
Apr
17
WebTech Conference 2010 - Bulgaria
Veliko Turnovo, Bulgaria
6th edition of WebTech conference will be held. A 2 day conference about : - Web Technologies - Blogs and blogging - Web 3.0 - Open Web - Mobile technologies - Internet Business
$y=decbin(3327);
echo $y."<br>";
$z = sprintf("%012d", $y);
echo $z;
I get
3327
110011111111
002147483647
Last row should be the same as the second one
Do you have an idea why?
This thread is for discussions of Output number with leading zeros.