|
Posted by windandwaves on 11/18/96 11:42
Mladen Gogala wrote:
> On Wed, 15 Mar 2006 23:05:09 +1300, windandwaves wrote:
>
>> 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):
>
> You should use shuffle() function. Are you trying to win powerball?
Not sure about the powerball thing. But this is how I did it in the end:
function randomizer($array, $itemsneeded) {
$r = array_rand($array, $itemsneeded);
foreach($r as $c) {
$v[$c] = $array[$c];
}
return $v;
}
Navigation:
[Reply to this message]
|