shuffle

Shuffle an array

&reftitle.description; `true` `shuffle` `array` `array`

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

&caution.cryptographically-insecure;
&reftitle.parameters;

`array`

- The array.

&reftitle.returnvalues;

&return.true.always;

&reftitle.changelog;

&Version; | &Description;
7.1.0 | The internal randomization algorithm has been changed to use the Mersenne Twister Random Number Generator instead of the libc rand function.

&reftitle.examples;

### `shuffle` example

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

&reftitle.notes; ¬e.no-key-association; ¬e.reset-index;
&reftitle.seealso;

- `Random\Randomizer::shuffleArray`
- `Random\Randomizer::shuffleBytes`
- `Random\Randomizer::pickArrayKeys`
- &seealso.array.sorting;