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

Functions, Part I Forum

View Course » View Exercise

68 points
D6b22b678504c12e7bcaac627d561a51?s=140&d=retro
Submitted by
Dusk665
over 2 years ago

I passed, but I still feel like a failure. Please help.

I passed the exercise, but when it prints out the winner, their name is not capitalized. Whats the problem? Is it unable to capitalize arrays for some reason?

$winner = $game[rand(0,count($game)-1)]
strtoupper($winner);
echo "$winner";

Where $game is an array filled with names

1 vote

permalink

Fixed it. Did not realized you could move $game[rand(0,count($game)-1)] into a strtoupper() and have it work.

68 points
D6b22b678504c12e7bcaac627d561a51?s=140&d=retro
Submitted by
Dusk665
over 2 years ago