|
Posted by Geoff Berrow on 03/19/06 03:49
Message-ID: <qFRRf.6343$JZ1.201628@news.xtra.co.nz> from windandwaves
contained the following:
>
>I want a random list of numbers between 0 and 58 where each number can only
>occur once. I have written this ($f is an array):
>
>for($i = 0; $i < 13; $i++) {
> $rand[$i] = mt_rand(0,count($f));
>}
>
>what else do I need?
Here is my lottery ball picker
<?php
asort($rand_keys = array_rand(array_fill(1, 49,''), 6));
print "Your Lotto Numbers are: <big>".implode($rand_keys,", ")."</big>";
?>
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Navigation:
[Reply to this message]
|