from php manual str_pad function


<?php
$input = "Alien";
print str_pad($input, 10);                      // produces "Alien     "
print str_pad($input, 10, "-=", STR_PAD_LEFT);  // produces "-=-=-Alien"
print str_pad($input, 10, "_", STR_PAD_BOTH);   // produces "__Alien___"
print str_pad($input, 6 , "___");               // produces "Alien_"
?>

pete

Diana Castillo wrote:
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



Reply via email to