As far as I can tell, this is correct, but the darn thing won't accept it!
// Create an array and push on the names // of your closest family and friends $closefriends = array("Jamie", "Bruce", "Tom", "Jack", "Rob", "Andreea"); array_push($closefriends, "Michael"); array_push($closefriends, "Smithy"); // Sort the list $sortedlist = sort($closefriends); $countedlist = count($closefriends); // Randomly select a winner! $random = rand(0,$countedlist -1); // Print the winner's name in ALL CAPS $winner = strtoupper($sortedlist[$random]); print $winner;
Is it me or a broken exercise? The error I get is 'Oops, try again. Remember to print out the name of the lucky winner!'