Skip to content

Commit

Permalink
improve leading zero
Browse files Browse the repository at this point in the history
  • Loading branch information
nrenvoise-ubitransport committed Jan 12, 2022
1 parent c7de22d commit 6a8d2ff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion string/add_leading_zeros/add_leading_zeros.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
$myAge = '34';
$myAgeWithLeadingZeros = str_pad($myAge, 5, "0", STR_PAD_LEFT);

echo $myAgeWithLeadingZeros."\n";
echo $myAgeWithLeadingZeros."\n";

echo "add 4 zeros before 1:\n".sprintf('%05d', 1);

0 comments on commit 6a8d2ff

Please sign in to comment.