I use this code to return random numbers without duplicates. I can't remember where I got it from but it isn't my code.

Code:
//returns an array of random keys between 2 numbers
function &UniqueRands($min$max$keys){
    static 
$returnme = array();
    while(
in_array($x rand($min,$max),$returnme));
    
$returnme[] = $x;
    if(
$keys count($returnme)-&& $keys < ($max-$min))
        
UniqueRands($min$max$keys);
    return 
$returnme;

Usage:

Code:
 //usage
$rands = & UniqueRands(0155);