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

For Loops in PHP Forum

View Course

330 points
Eed9249ac76ed2aafa246c286f11e2e0?s=140&d=retro
Submitted by
Newcoder70
about 2 years ago

Exercise 7/7 Was touchdown put in the code as a problem solver?

This is the only way I could get the array to print

    foreach($yardlines as $item) {




         echo $item;



The 50... the 40... the 30... the 20... the 10... 

0 votes

permalink

And what is the issue with this solution?

1409 points
588b2ac3e1281365f0000133_918398059
Submitted by
Codmakr
about 2 years ago

1 Comment

8c6f5e100036b30914925dcaee2818b4?s=140&d=retro alexandre-sccp about 2 years ago

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

        }

    // Write your foreach loop above this line
    echo "touchdown!";
  ?>