From http://www.w3schools.com (Copyright Refsnes Data)
Complete PHP Array Reference
The shuffle() function randomizes the order of the elements in the array.
This function assigns new keys for the elements in the array. Existing keys will be removed.
This function returns TRUE on success, or FALSE on failure.
shuffle(array) |
| Parameter | Description |
|---|---|
| array | Required. Specifies the array to use |
<?php
$my_array = array("a" => "Dog", "b" => "Cat", "c" => "Horse");
shuffle($my_array); print_r($my_array); ?> |
The output of the code above could be:
Array ( [0] => Cat [1] => Horse [2] => Dog ) |
Complete PHP Array Reference
From http://www.w3schools.com (Copyright Refsnes Data)