How to shuffle an array in PHP?
shuffle php function
<?php
$i_arr = ["html", "css", "javascript", "php", "vue", "react"];
echo "<pre>";
print_r($i_arr);
echo "</pre>";
shuffle($i_arr);
echo "<pre>";
print_r($i_arr);
echo "</pre>";
?>
Randomize the order of the elements in the array:
<?php
$my_array = array("red","green","blue","yellow","purple");
shuffle($my_array);
print_r($my_array);
?>