PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php $arr = [0,1,2,3,4,5,6,7,8,9]; $cnt = count($arr); $shuffled = []; while ($cnt>0) { $shuffled = array_merge($shuffled, array_splice($arr, rand(0, $cnt), 1)); $cnt--; } print_r($shuffled);
Show:  
Copy Clear