Created
August 12, 2015 04:24
-
-
Save vansosnin/aab554cb25226b5104c5 to your computer and use it in GitHub Desktop.
Fixed length random number
This file contains hidden or 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 big_rand($len = 9) | |
{ | |
$rand = ''; | |
while (!(isset($rand[$len - 1]))) { | |
$rand .= mt_rand(); | |
} | |
return substr($rand, 0, $len); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment