Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<?php
$my_array = array("red","green","blue","yellow","purple");
shuffle($my_array);
print_r($my_array);
?>
<p>Refresh the page to see how shuffle() randomizes the order of the elements in the array.</p>
</body>
<!-- Mirrored from www.w3schools.com/php/phptryit.asp?filename=tryphp_func_shuffle by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 21 Dec 2022 17:22:39 GMT -->
</html>
Array ( [0] => yellow [1] => purple [2] => red [3] => blue [4] => green )

Refresh the page to see how shuffle() randomizes the order of the elements in the array.