Shuffling list in PHP

shuffle() function in PHP allows to shuffle all the values in an array randomly.

Source code :

<?php
$arr = array("africa","india","america","germany");

shuffle($arr);
print_r($arr);// it displays into a human readable output.
?>

Output :

Array
(
    [0] => germany
    [1] => india
    [2] => america
    [3] => africa
)


Output :


                

Comments :