Question : php add three zeros prefix
Answered by : lovely-llama-lpft77abt2tl
<?php
$num = 4;
$num_padded = sprintf("%02d", $num);
echo $num_padded; // returns 04
?>
Source : https://stackoverflow.com/questions/5659042/php-prepend-leading-zero-before-single-digit-number-on-the-fly | Last Update : Sat, 02 May 20