$testArray =array('a'=>'apple','b'=>'ball','c'=>'cat','d'=>'dog'); $keys =array_keys($testArray); //Get the Keys of the array -> a, b, c, dshuffle($keys); //Shuffle The keys array -> d, a, c, b $shuffledArray =array();foreach($keys as $key) { $shuffledArray[$key] = $testArray[$key]; //Get the original array using keys from shuffled array }print_r($shuffledArray);/* Array ( [d] => dog [a] => apple [c] => cat [b] => ball ) */