PHP.nl

shuffle

shuffle

Shuffle an array

true **shuffle** array $array

This function shuffles (randomizes the order of the elements in) an array.

arrayThe array.

return.true.always

Voorbeeld: example

<?php
$numbers = range(1, 20);
shuffle($numbers);
foreach ($numbers as $number) {
    echo "$number ";
}
?>

Random\Randomizer::shuffleArray``Random\Randomizer::shuffleBytes``Random\Randomizer::pickArrayKeys