Are there any alternative functions in PHP that can be used to select random elements from an array?

When selecting random elements from an array in PHP, the `array_rand()` function is commonly used. However, an alternative function that can be used for this purpose is `shuffle()` followed by `array_slice()` to select a random subset of elements from the array.

// Original array
$originalArray = [1, 2, 3, 4, 5];

// Shuffle the array
shuffle($originalArray);

// Select a random subset of elements
$randomSubset = array_slice($originalArray, 0, 3);

// Output the random subset
print_r($randomSubset);