Created
February 4, 2014 22:34
-
-
Save kworthington/8813754 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
/* Reference: http://mattonomics.com/guess-a-four-digit-number-in-php/ */ | |
/* I didn't look into how to pass into POST variables, but this will spit out 0000-9999 */ | |
$input = 0; | |
while ($input < 10000) | |
{ | |
echo str_pad($input, 4, "0", STR_PAD_LEFT) . "<br />"; | |
$input++; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice!
You could make that really short like so: https://gist.github.com/mattonomics/20858ffecf431e794148