I have this function:
function card_draw ($numeroDeobjetos) {
for ($i=0; $i<$numeroDeobjetos; $i++) {
$aleatorio=rand (1,40);
$usada[$aleatorio]=true;
}
for ($i=0; $i<=39; $i++) {
if ($usada[$i]==false) {
echo '<img src="card.jpg">';
}
else {
echo '<img src="'.$i.'.jpg">';
}
}
}
How can I do to prevent repeated numbers in $aleatorio?
Thank you.