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

For Loops in PHP Forum

View Course » View Exercise

47 points
Submitted by
over 4 years ago

What's wrong ? Thanks in advance

It looks like your loop didn't echo 'The 50... ' :

$yardlines = array("The 50... ", "the 40... ",
"the 30... ", "the 20... ", "the 10... ");
foreach ($yardlines as $touchdown){
echo "$touchdown!" ;

1 vote


The problems that I see are the you aren't calling $touchdown as a variable in your echo statement, but instead you've encased it in quotes as if it's a string. No quotes are needed on variables, because the quotes already exist for the variable as you added them to the variable already when you created it. You simply put

echo $touchdown;

Then, at the bottom, you'll need to change that probably to get the step passed and move on to the next. At the bottom of that particular step, it's not unset($touchdow); but rather it should be this:

echo "touchdown!";

That should fix you up!

974 points
Submitted by
randy cramer
about 4 years ago

1 Comment

52a8c9b77c82ca1c0b0000cb_40780846 LLAMAMASTER23456 about 4 years ago

touchdow might also be your problem.