Archive for April, 2011

Shuffling associative array

Tuesday, April 19th, 2011

We have shuffle() to reorder a numeric array, we have array_rand() to randomly pick a specific number of values from an array but there’s no built-in command for shuffling an associative array. After having seen a few pretty bad solutions I decided to offer my own.