laravel number add 0 before
snippet in php

laravel number add 0 before

user8325

<?php
$num = 4;
$num_padded = sprintf("%02d", $num);
echo $num_padded; // returns 04
?>