On the php documentation,i found this note:
On both 32 and 64-bit systems (OS X and Linux), mt_getrandmax()
returns 2147483647
I have confirmed this using the simple function provided
function gethighest()
{
return mt_getrandmax();
}
$hello = gethighest();
echo '<b>'.$hello.'</b>';
I am using this snippet to generate a unique id
$number = mt_rand(163245,978534);
$unique_id = crypt($number);
echo md5($unique_id).'<br/>';
My question is,what does it mean to have a max value for mt_rand?.Will the ids begin to repeat once the max value is reached?.
Your code:
means that the number generated will be between those 2 numbers, it will for as many times as you run it, generate a number between those 2 values.. No returned value will be outside that range. But yes, values can be repeated..
eg try it with mt_rand(1,5) and tell it to do it 20 times and output.