Created
November 29, 2014 00:42
-
-
Save codeliger/e89d4a573b374a5b4a06 to your computer and use it in GitHub Desktop.
A zerofill function for numbers in php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function zerofill($num, $max, $pad = "0"){ | |
return str_pad($num, strlen($max), $pad, STR_PAD_LEFT); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment