Skip to content

Instantly share code, notes, and snippets.

@asadaly111
Created March 22, 2018 15:06
Show Gist options
  • Save asadaly111/a6effd7db7e1afc6485dd05fa5150a76 to your computer and use it in GitHub Desktop.
Save asadaly111/a6effd7db7e1afc6485dd05fa5150a76 to your computer and use it in GitHub Desktop.
generating number of series in php
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