Fixed Length & Large Random Numbers with PHP

PHP’s random number functions generate integers with variable number of digits. Also, the maximum size of the random number generated that way is PHP_INT_MAX. You can remove these two limitations using the function below.

How to use

What is different in this function is that you have to specify a length, rather than a range, to generate the random number. Here is how to use it: