Re: random array sort
| From: | David Rice | Date: | Tue, 10 Sep 2002 14:48:52 +0000 |
| Subject: | Re: random array sort | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-115854@lists.php.net to get a copy of this message | ||
But if array_rand() truly pulls out random keys, how do you guarantee that you are not randomly pulling out the same key as you iterate through the array?
Perhaps you could set the number of keys to return, to the size of the array, and somehow, magically, all the keys would be included in the returned array of keys.
i.e. array_rand ( array , array_size)
I have no idea what this would produce...
-David
On Tuesday, September 10, 2002, at 10:33 AM, Mike At Spy wrote:
You could use array_rand() to take stuff out of the array at random and then stuff it all back into another array. -Mike-----Original Message----- From: ROBERT MCPEAK [mailto:RMCPEAK@jhuccp.org] Sent: Tuesday, September 10, 2002 10:22 AM To: php-general@lists.php.net Subject: [PHP] random array sort Could someone show me a quick and simple way to randomly sort array elements? I can't seem to pinpoint the correct parameters in the docs. Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php