Posted by Kimmo Laine on 09/29/33 11:42
"windandwaves" <winandwaves@coldmail.com> wrote in message
news:qFRRf.6343$JZ1.201628@news.xtra.co.nz...
> Hi Folk
>
> 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?
$randomstuff = range(0,58);
shuffle($randomstuff);
print_r($randomstuff);
--
"En ole paha ihminen, mutta omenat ovat elinkeinoni." -Perttu Sirviφ
spam@outolempi.net | Gedoon-S @ IRCnet | rot13(xvzzb@bhgbyrzcv.arg)
Navigation:
[Reply to this message]
|