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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![thimoschroeder](https://uploads.teamtreehouse.com/production/profile-photos/1017462/micro_flat_1000x1000_075_f.jpg)
thimoschroeder
23,470 PointsCreating the Catalog array - echo & carnation question
Hey, we created an array in the catalog.php folder:
<?php $catalog = array( "Design Patterns", "Forrest Gump", "Beethoven" );
and then moved on to to echo the code with the following:
<?php foreach($catalog as $item) { echo "<li>" . $item . "</li">"; } ?>
I didn't understand how to include the li's inside the code and what the "." should display !
Hope, that someone is able to clarify this.
3 Answers
![Serhii Lihus](https://secure.gravatar.com/avatar/9abc7562b44a45cd9b0a619cb6c2bfbd?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Serhii Lihus
6,352 PointsYou've done everthig correct except one small thing, additional double quotes inside of the double quotes. If you are putting same quotes inside of the same quotes than you should escape them like this:
echo "some text \" inside of some text\"";
dot sign inside of echo statement means string concatenation, it's a part of php language(and you wont see them in output). In code below you are adding text(which you receive from array) into <li></li>(list items). So, when you render the page you'll receive this output:
<li>Design Patterns</li>
<li>Forrest Gump</li>
<li>Beethoven</li>
Working code:
$catalog = array( "Design Patterns", "Forrest Gump", "Beethoven" );
foreach($catalog as $item) {
echo "<li>" . $item . "</li>";
}
Hope this explains how thing works ;)
![Chris Davis](https://uploads.teamtreehouse.com/production/profile-photos/6921182/micro_Fi-M-Top10-Sensei-Masters-in-Movies-and-TV-480p30_480.jpg)
Chris Davis
16,280 Pointsyou could also use...
echo "<li>$item</li>";
![thimoschroeder](https://uploads.teamtreehouse.com/production/profile-photos/1017462/micro_flat_1000x1000_075_f.jpg)
thimoschroeder
23,470 PointsSerhii Lihus - all right, thanks for your help, this clarifies the issue I ran into !