PHP shuffle() Function

The shuffle() function is used to randomize the order of the elements in the array. The function assigns new keys to the elements in array.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 (See Example 1 below).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.

Example -

Example -