Reorders an array randomly.
shuffle() orders the elements in an array randomly. In versions prior to PHP 4.2.0, the randomizer should be seeded.
<?php
$array1 = range(1, 9);
shuffle($array1);
foreach ($array1 as $element) {
print "$element ";
}
?>
7 3 1 6 8 5 4 9 2
The digits 1 through 9 are randomly reordered.