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

For Loops in PHP Forum

View Course » View Exercise

66 points
F0b7b9afc207a2d3c247be47f6b8d0c7?s=140&d=retro
Submitted by
Athian Akec
over 2 years ago

whats wrong with my code?

<?php
$yardlines = array("The 50... ", "the 40... ",
"the 30... ", "the 20... ", "the 10... ");
foreach ($yardlines as $lol) {
}

    echo $lol;

    echo "touchdown!";
  ?>

0 votes

permalink

Your "echo $lol;" should be inside your for loop as it is the statement you want to be printed every time.

881 points
54e1251b76b8fead7f0073dc_298875240
Submitted by
aylham
over 2 years ago