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

For Loops in PHP Forum

View Course » View Exercise

404 points
51b2a6359c4e9d3a9b002c82_43559808
Submitted by
jwrodriguez
almost 4 years ago

confused

<?php
$yardlines = array("The 50... ", "the 40... ",
"the 30... ", "the 20... ", "the 10... ");
// Write your foreach loop below this line
foreach($yardlines as $The50)
{
// Write your foreach loop above this line
echo "The 50...";
}
?>


0 votes

permalink

You need a second variable to print array values.

foreach($yardline as $yard){
    echo $yard;
}

538 points
919ddc943ca721fa46eca5228ea37ee3?s=140&d=retro
Submitted by
Ignacio
almost 4 years ago