Menu
I’ve been trying to make a script that generates random lotto numbers. The problem is, the numbers generated, aren’t always unique. Sometimes the same number is rolled twice. Any Ideas?
[code=php]
<?php
$n1 = mt_rand(1,47);
$n2 = mt_rand(1,47);
$n3 = mt_rand(1,47);
$n4 = mt_rand(1,47);
$n5 = mt_rand(1,47);
$bonus = mt_rand(1,27);
print “<p>$n1, $n2, $n3, $n4, $n5, <span style=”color:red”>$bonus</span></p>n”;
?>
Example: [url]http://vintagecloning.host.sk/lotto.php