note 121088 deleted from function.shuffle by cmb
| From: | cmb@php.net | Date: | Mon, 22 Nov 2021 17:23:52 +0000 |
| Subject: | note 121088 deleted from function.shuffle by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-217283@lists.php.net to get a copy of this message | ||
Note Submitter: thomas dot sahlin at invented dot se
----
Here's a simple one liner for shuffling associative arrays:
<?php
uksort($myArray, function ($a, $b) {return mt_rand(-10, 10);});
?>