note 54722 deleted from function.rand by felipe

From: Date: Sun, 30 Dec 2007 18:43:42 +0000
Subject: note 54722 deleted from function.rand by felipe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-134425@lists.php.net to get a copy of this message
Note Submitter: Corry Gellatly ncl.ac.uk ---- I need to generate large arrays of random numbers within specific ranges. The function provided by mark at mmpro dot de is good stuff, but if the range of your random numbers ($max - $min) is less than the number of elements in the array ($num), i.e. you want to permit duplicate values, then: Alter this line: while (in_array($a,$ret)); to this: while (next($ret));

« previous php.notes (#134425) next »