Ajax-loader-large-white
For Loops in PHP
All On Your Own!

Great work! Now let's see you write a foreach loop all on your own.

Instructions

On line 8, there's an array named $yardlines. Write a foreach loop that iterates over the array and echos each element to the page.

?
Stuck? Get a hint! Hint
Get live, fast support from Codecademy Advisors when you get stuck. Learn more.

Here's a foreach loop that iterates over an array named $numbers and echos each element to the page:

<?php
  $numbers = array(1, 2, 3);

  foreach($numbers as $item) {
      echo $item;
  }
?>
index.php
project
View Preview