note 6076 deleted from function.shuffle by nlopess
| From: | nlopess@php.net | Date: | Thu, 24 Jun 2004 16:18:51 +0000 |
| Subject: | note 6076 deleted from function.shuffle by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-71602@lists.php.net to get a copy of this message | ||
Note Submitter: scott
----
Shuffle doesn't work very well. Especially if you're shuffling mySQL rows...use rand()
instead, like:
$num = rand(0,count($rows)-1);
$row = $rows[$num];
Hope this helps..took me a while to debug it and figure out that shuffle favors some numbers over
others...