Task description is to use functions: count(), rand(), and strtoupper() to get random name printed out of my PHP array in all caps. Code: http://ideone.com/nwjyoa
<?php
// Create an array and push on the names
$friends=array("Mike", "Ondrej", "Honza", "Danca", "Misa", "Verca");
array_push($friends, "Michal", "Vendulka", "Daniela");
// Sort the list
sort($friends);
// Randomly select a winner!
$winner = array_rand($friends, 1);
echo "<p>$winner</p>";
// Print the winner's name in ALL CAPS
?>
I got so far to choosing a random value from the array, but it gives me its number(position), not a name :/
Could you please point me in the right direction to solving that?