This forum is now read-only. Please use our new forums at discuss.codecademy.com.

Functions, Part I Forum

View Course

931 points
037eaef6d8465534a76b7aefcc130f85?s=140&d=retro
Submitted by
Edward Setina
about 2 years ago

8/8???

I keep getting a message saying that I didn't remember to print the winning name. Any ideas? Thanks!

<?php
// Create an array and push on the names
// of your closest family and friends
$family = array();
arraypush($family,"Joe");
array
push($family,"Dudely");
arraypush($family,"Zipper");
array
push($family,"Leroy");
arraypush($family,"Suzie");
array
push($family,"Billingsworth");
// Sort the list
sort($family);
// Randomly select a winner!
$win = $family [rand(0, count($family)-1)];
// Print the winner's name in ALL CAPS
print strtoupper($win);
?>


0 votes

permalink

array_push

581 points
Dfbe6c8626c7c53b27472f889b6f5b82?s=140&d=retro
Submitted by
tupedd
about 2 years ago

1 Comment

1a69d3fe0f41825b5a9c418ec7a8dfe3?s=140&d=retro az6600 about 2 years ago

I have array_push but it still doesn't work.