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

problem 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

Try removing the second echo

<?php foreach($products as $product) { echo "< l i>" . $product . "< /li >" ;} ?>

I dont know what exercise you are on but you code is valid. Except for echo "< l i>" should be
echo "<li>"

is 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>

Well then both Don Shipley and my answers should work