8. Remember to print out the name of the lucky winner!


#1

Hello there,
I thought I worked it out, it is even printing a random name in capital letters, but when I submit it I get:

Oops, try again.
Remember to print out the name of the lucky winner!

Please help me figure it out. This is my code:

<?php
    // Create an array and push on the names
    // of your closest family and friends
    $participants = array();
    array_push($participants, "Carmen");
    array_push($participants, "Norbert");
    array_push($participants, "Carina");
    array_push($participants, "Patrick");
    array_push($participants, "Simon");
    array_push($participants, "Nina");
    array_push($participants, "Debby");
    array_push($participants, "Melbo");
    array_push($participants, "Klaus");
    
      // Sort the list
    sort($participants);
    // Randomly select a winner!
    $winner = $participants[rand(0, count($participants)-1)];
    // Print the winner's name in ALL CAPS
    print strtoupper($winner);
    ?>

Functions Part 1 - Exercise 8
#2

I don't see anything wrong there. When I copy/paste/submit it passes for me.

Try reloading/refreshing the web page.


#3

Hey,
just wanted to let you know, that I found my mistake :sweat_smile:
I must have somehow deleted the html tags...


#4

Thanks for posting an update.


#5

Oops, try again. Remember to print out the name of the lucky winner!

BUT IT WORKS PERFECTLY FINE!!!


#6

Yes it works. I just think in a different way which is hard to do. But this is a perfect solution. Thanks for this.