note 26865 deleted from function.shuffle by aidan
| From: | aidan@php.net | Date: | Thu, 26 Aug 2004 22:34:06 +0000 |
| Subject: | note 26865 deleted from function.shuffle by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-75367@lists.php.net to get a copy of this message | ||
Note Submitter: drmccolgan at aol dot com
----
Yet another array shuffle routine.
===============================
function swapshuffle($array) {
srand ((double) microtime() * 10000000);
for ($i=0;$i<sizeof($array);$i++) {
$from=rand(0,sizeof($array)-1);
$old=$array[$i];
$array[$i]=$array[$from];
$array[$from]=$old;
}
return $array;
}
================================