Tuesday, November 10, 2009

PHP Leading Zero for Double Digit Numbers -- Padding a Number with zeros


<?php
for ($num = 1; $num <= 31; $num++)
{
$day = sprintf("%02d", $num);
echo "<p>$day</p>";
}

PHP Leading Zero for Double Digit Numbers


Add a leading zero to a single digit integer



--
******************************************************
http://www.venkatmails.blogspot.com/

When you hire people who are smarter than you , you prove you are smarter than them.  
-------------------------------------------------
"If you open your heart, love opens your mind."
-------------------------------------------------
"Begin with an end in mind"
-------------------------------------------------
"Never make the same mistake twice ,there are so many new ones to make...Good day!"
-------------------------------------------------
Try to be serious! Why? Not to hurt others feelings
How about treating others, the way you'd wanna be treated.
Fine, don't be a fuddy duddy!

http://www.venkatmails.blogspot.com/
******************************************************

No comments:

Post a Comment