'; shuffle($arr); print_r($arr); ?>
Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 [5] => 6 [6] => 7 [7] => 8 )
Array ( [0] => 6 [1] => 1 [2] => 3 [3] => 2 [4] => 5 [5] => 7 [6] => 8 [7] => 4 )
如果是二维关联数组,也可用该方法 【打乱数组|打乱数组 shuffle】转载于:https://www.cnblogs.com/pansidong/p/11556041.html