Run ❯
Get your
own PHP
server
Result Size:
625 x 565
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <body> <?php $my_array = array("a"=>"red","b"=>"green","c"=>"blue","d"=>"yellow","e"=>"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> </html>
Array ( [0] => red [1] => yellow [2] => green [3] => purple [4] => blue )
Refresh the page to see how shuffle() randomizes the order of the elements in the array.