Hiya,

I am generating a "random" 10-digit number in PHP, here is my code:

Code:
$num1 = rand(10000, 99999);
$num2 = rand(10000, 99999);
$num = $num1 . $num2;
This works, but is this the best way to go about it? the resulting number must be numeric, and must always be 10 digits long.

Using PHP 4.3.2 with a max random number size of 2147483647

Cheers,

Jsaon