What are some alternative methods for shuffling and selecting random elements in a PHP array?

When working with PHP arrays, it may be necessary to shuffle the elements or select random elements from the array. One common method is to use the `shuffle()` function to randomly shuffle the array elements. Another option is to use the `array_rand()` function to select random keys from the array and then retrieve the corresponding values.

// Shuffle the elements of an array
$myArray = [1, 2, 3, 4, 5];
shuffle($myArray);
print_r($myArray);

// Select a random element from an array
$myArray = ['apple', 'banana', 'cherry', 'date'];
$randomKey = array_rand($myArray);
$randomElement = $myArray[$randomKey];
echo $randomElement;