Zero Padded Numbers

0
0
function getZeroPaddedNumber($value, $padding) {
       return str_pad($value, $padding, "0", STR_PAD_LEFT);
}

#Usage

echo getZeroPaddedNumber(123, 4);
// outputs "0123"
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.