Maybe I dont completely understand what you are attempting. But you only need a for loop and the rand() function.
If you read the specs of the rand function at http://www.php.net/rand you will see that you can set a min and max for the rand().
thus if you...
for ($x = 0; $x <= 2000; $x++) {
echo (rand(10000, 99999) . "<br>");
}
this should print out 2000 random numbers between 10000 and 99999 (5 digits)
Let me know if this is not what you are looking for
PHPdev