Tuesday, April 23, 2013


<?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

0 comments:

Post a Comment