Potresti utilizzare:

http://www.php.net/range
http://www.php.net/array_rand