HS Banner
Back
PHP Shuffle

Author: Admin 09/11/2022
Language: PHP
Tags: php shuffle array


Description:

Randomizes the order of the elements in an array.

Article:

This function shuffles (randomizes the order of the elements in) an array. It uses a pseudo random number generator that is not suitable for cryptographic purposes.

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

Read more PHP: shuffle - Manual



Back
Comments
Add Comment
There are no comments yet.