Php Add Three Zeros Prefix

[Solved] Php Add Three Zeros Prefix | Php - Code Explorer | yomemimo.com
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

Answers related to php add three zeros prefix

Code Explorer Popular Question For Php