Prepend leading zero before single digit number in php by Unknown on 06:20 Prepend leading zero before single digit number <?php $num = 4; $num_padded = sprintf("%02d", $num); echo $num_padded; // returns 04 ?> Tweet Share Share Share Share
0 comments: