Created
January 25, 2016 00:02
-
-
Save amikitevich/febed1444cb85259a693 to your computer and use it in GitHub Desktop.
Число с ведущими нулями
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 | |
$str = '1'; | |
echo sprintf("%04d", $str); | |
// Выводит "0001" | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment