Fills the first argument (mostly a number, f.e. from a <select> loop to display a date or time) with zeroes.
<?php
function zerofill($mStretch, $iLength = 2)
{
$sPrintfString = '%0' . (int)$iLength . 's';
return sprintf($sPrintfString, $mStretch);
}
?>
sprintf() is indeed faster than str_pad.