There is a problem with my code and I can't figure out what's wrong. It works, but when I click on "Save and Submit" I get an error, but the code works and does what it's supposed to. Could someone find the problem?
Here is my code:
<html> <p> <?php // Create an array and push on the names // of your closest family and friends $family = array("Theodoros","George","Chris"); // Sort the list sort($family); // Randomly select a winner! print strtoupper($family[rand ( 0, count($family)- 1)]); // Print the winner's name in ALL CAPS ?> </p> </html>
Here are the instructions:
Create an array() with the names of your closest family and friends. The more names in your array, the more fun your game will be!
After you've created your list, sort it and randomly select a name from the list.
When you have your winning name, print it to the screen in caps so everyone knows how awesome the winner is.
Functions we'll use here: array(), array_push(), sort(), count(), rand(), and strtoupper(). Play around with some of the other functions you've learned as well.