Am stucked in the last exercise of "Function part 1"


I can't really get my rand function to print the winner correctly from my array. Can someone really help?


As an Array can only be accessed using an INTEGER
you will have to round() your random() outcome....
and on top of that you will have to use the strtoupper() Method.....


See you have to get the rand number by using the rand() and you have to access the rand winner by just calling out the array().Nothing big deal,it's quite cool if you look into this deeply.Hope my below code give you a right perception.

// Create an array and push on the names
// of your closest family and friends
// Sort the list
// Randomly select a winner!
// Print the winner's name in ALL CAPS
print strtoupper($c);


After running your code also i am getting an error message as Remember to print out the name of the lucky winner!


Thanks a lot!

I realised I did't have to make another variable here:


So do I!:joy:joy:joy:joy: