PHP randomise a variable

If you want to randomise a PHP variable the following code is a great example:

$vars = ['Apple', 'Orange', 'Melon', 'Lemon', 'Lime'];
$random = $vars[mt_rand(0, count($vars) - 1)];
echo $random;

This will choose 1 string from the array $vars┬ámeaning it will be completely random each time what will be echo’d.