Hello,
> I would take each number and place it in an array.
> Then for each
Thank you very much. It has been really very helpful
for me.
Vous manquez despace pour stocker vos mails ?
Yahoo! Mail vous offre GRATUITEMENT 100 Mo !
Créez votre Yahoo! Mail sur ht
From: "Henri Marc" <[EMAIL PROTECTED]>
I want to generate a few numbers and those numbers
must not be generated two times.
function getnumbers($howmany, $min, $max)
{
$retval = array();
while(count($retval) < $howmany)
{ $retval[mt_rand($min,$max)] = 1; }
return array_keys($retval);
}
Not teste
[snip]
How would you do?
[/snip]
I would take each number and place it in an array. Then for each
subsequent number I would test to see if in_array()...if not add the
number to the array, if it is then do the calc again...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: h
3 matches
Mail list logo