What's wrong?


#1


Functions, Part I Exercise 1.8


When I click save & submit code, an error comes up that says remember to print out the name of the lucky winner but the winner is already printed out and I don't see anything wrong with the code. Please help me.

$names = array();
    array_push($names,"Mama");
    array_push($names,"Daddy");
    array_push($names,"Cynthia");
    array_push($names,"Jessie");
    array_push($names,"Me");
    array_push($names,"Aardvark (yup, thats me)");
    array_push($names,"Xela");
    array_push($names,"Inno");
    array_push($names,"Jadyn");
// Sort the list
sort($names);
$random = rand(0,count($names) -1);
$winner = strtoupper($names[$random]);
print $winner;


#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.