Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP Build a Simple PHP Application Listing Inventory Items Introducing Arrays

Hello, need some help please, thank you.

hummm... i do not know what to do, regarding the step number 6, what do i have to do???, help please.

2 Answers

Tom Bedford
Tom Bedford
15,645 Points

Hi Juan

After stage 5 your code should look like:

<?php

$letters = array("D","G","L");

echo "My favorite ";
echo count($letters);
echo " letters are these: ";

foreach($letters as $letter) {  
  echo "AB";
}

echo ".";

?>

Stage 6 is asking you to change the echo in the foreach loop to display each letter from the $letters array. This is the area where the change needs to happen:

foreach($letters as $letter) {  
  echo "AB"; // how do you make this show a letter from the $letters array?
}

I figured out a few mins ago, thank you very much for your time and help:D