Created
March 22, 2018 15:06
-
-
Save asadaly111/a6effd7db7e1afc6485dd05fa5150a76 to your computer and use it in GitHub Desktop.
generating number of series 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
Here's a slightly more standard way of doing it. | |
<?php | |
printf('%05d', 5); #00005 | |
printf('%05d', 50); #00050 | |
printf('%05d', 505); #00505 | |
printf('%05d', 5050); #05050 | |
printf('%05d', 50505); #50505 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment