<?
srand ((double)microtime()*1000000);
for($i=1; $i<4; $i++){ // mit der 4 wird die Anzahl der Zahlen bestimmt
$val = rand(1,10); // zwischen 1 und 10
(!strpos(" ".$vals, "$val")) ? $vals .= $val." " : $i--;
}
$vals = str_replace(" ",",",trim($vals));
echo $vals;
?>