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 tested, but should work. Probably want to add some checks in there so you don't end up in an infinite loop, though. :)

---John Holmes...

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to