RE: [PHP] How to get a unique series of numbers?

2004-08-23 Thread Henri Marc
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 d’espace pour stocker vos mails ? Yahoo! Mail vous offre GRATUITEMENT 100 Mo ! Créez votre Yahoo! Mail sur ht

Re: [PHP] How to get a unique series of numbers?

2004-08-20 Thread John Holmes
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

RE: [PHP] How to get a unique series of numbers?

2004-08-20 Thread Jay Blanchard
[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