Voting

: max(four, seven)?
(Example: nine)

The Note You're Voting On

christian dot reinecke at web dot de
18 years ago
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.

<< Back to user notes page

To Top