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

Matt Freeman
Matt Freeman
3,990 Points

Listing Inventory Items

task 6/7 Please some explain because this is making me more and more frustrated !!! i've looked at different forums and answers but nothing wants to Work !!!

Hi Matt,

Can you please post the code you are using?

1 Answer

Understanding loops and arrays is very important before moving forward with PHP, so if you don't think you have a good grasp on the concepts, I would recommend watching the video(s) over again and playing around with the coding until you have got it down.

What they are asking in this challenge is to change the static "AB" text to instead echo out the value of the $letter variable. Like this:

<?php

$letters = array("D", "G", "L");
echo "My favorite ";
echo count($letters);
echo " letters are these: ";
foreach($letters as $letter){
    echo $letter;
}
echo ".";

?>

Hope that helps ... and try not to get too frustrated. Sometimes you need to walk away and give your eyes (and mind) a rest before giving it another shot. Good luck!