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
pietro capriata
18,066 Pointsproblem between html e php
why He did'nt write:
<?php foreach($products as $product) { echo "< l i>"; echo $product; echo"< /li >";} ?>
is not the same?
3 Answers
Don Shipley
19,488 PointsTry removing the second echo
Joseph Greevy
4,990 PointsI dont know what exercise you are on but you code is valid.
Except for
echo "< l i>"
should be
echo "<li>"
pietro capriata
18,066 Pointsis not an exercise... I'm trying to see the code of the e-commerce... in whitch the foreach not echo every <li>"product name"</li> but only <li> echo product </li>
Joseph Greevy
4,990 PointsWell then both Don Shipley and my answers should work
Don Shipley
19,488 PointsDon Shipley
19,488 Points<?php foreach($products as $product) { echo "< l i>" . $product . "< /li >" ;} ?>