Look at:
http://www.php.net/mt_rand
You need to seed the random number generator:
mt_srand ((float) microtime() * 1000000);
This command ensures that we have a nice and random number, and then we get a random value from mt_rand(min, max):
$val = mt_rand(1,10);
Now $val will have a random number between 1 and 10.
Hope that helps!
Chris King