Show What You Know Problem


#1

After an hour or so of copying other people's code and changing it slightly I still get an error:
Remember to print out the name of the lucky winner!
Here's what I put together:

<?php
    // Create an array and push on the names
    // of your closest family and friends
    $friends = array();
    array_push ($friends, "k");
    array_push ($friends, "i");
    array_push ($friends, "p");
    array_push ($friends, "Q");
    // Sort the list
    count(0, 3);
    sort($friends);
    // Randomly select a winner!
    rand(0,3);
    // Print the winner's name in ALL CAPS
    print strtoupper($friends{rand(0,3)});
?>

It seems to work on the console. Any help would be appreciated.


#2

Hi @d123659,

You have to wait for some string to appear in the console before hitting Save & Submit Code. Sometimes it may function sporadically, so please try two or three times again. It worked for me on the second try.

Hope it helps! :slightly_smiling: