You've gotten a few responses already...  but since you didn't describe the
application, here is an alternative if you are using the random numbers to
retrieve random records from a database (postgreqsl in this example);

$query = "SELECT * FROM table ORDER BY random() LIMIT 5";

am usre the MySQL and others have similar constructs...  again, just in case you
were looking for database use and not just the number use (which others have
more than adequately answered for you).


>-----Original Message-----
>From: Seb Frost [mailto:[EMAIL PROTECTED]]
>Sent: Monday, August 20, 2001 9:13 PM
>To: PHP General List
>Subject: [PHP] Picking random numbers
>OK I want to pick 5 random numbers from 1 to 200.  Easy.  They must all be
>different.  Not so easy.
>And I don't want to use shuffle because of the comments on about it.
>- seb
>PHP General Mailing List (
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]

PHP General Mailing List (
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to