note 85828 deleted from function.mt-rand by salathe
| From: | salathe@php.net | Date: | Fri, 07 Nov 2014 11:01:28 +0000 |
| Subject: | note 85828 deleted from function.mt-rand by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-200812@lists.php.net to get a copy of this message | ||
Note Submitter: xphere81 at hotmail dot com
----
@Jonathon
$id_list = range($min, $max);
shuffle($id_list);
This is a faster way to obtain a list of unique id's in a random order.
It's always better to use PHP predefined functions, isn't it? ;)
Also remember that calling mt_rand too many times can downgrade the performance of ANY algorithm.