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 trialsebastian rojas
571 PointsListing inventory items, stage 4 "challenge 6,7
Hey fellas! I'm having some hard time at Stage 4 "Listing Inventory Items" challenge task 6 of 7 but i would appreciate someone to help me with the whole code for 7 also
the code i have atm is
<?php
$letters = array("D", "G", "L"); echo "My favorite "; echo count($letters); echo " letters are these: "; foreach ($letters as $letter) { echo "AB"; } echo ".";
?>?>
Kind regards, Sebastian
2 Answers
Dino Paškvan
Courses Plus Student 44,108 PointsAt stage 6, it's a simple change. Instead of echoing "AB"
, you echo out $letter
inside the foreach
. As for stage 7, it's extremely simple, you just add another letter to the array.
sebastian rojas
571 PointsHAHAH, you are so right! It wasn't that hard i'm just tired and confused :D Big thanks to you Dino!
Dino Paškvan
Courses Plus Student 44,108 PointsNo problem, and good luck with the rest of the challenges. :)