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
Darry Berger
Courses Plus Student 6,818 PointsPHP arrays code challenge stuck at 5/7. help!
Here are the instructions :
Right now, the unordered list does not show the flavors from our array. In the next few tasks, we'll change that. This task has two steps. (1) Add the start of a foreach loop with an opening curly brace after the opening <ul> tag but before the first opening <li> tag. The foreach loop should load each element from the flavors array, one at a time, into another variable named flavor. (2) Add the closing curly brace for the foreach loop after the final closing </li> but before the closing </ul>.
And this is my code:
<?php
$flavors = array("Chocolate","Vanilla","Bubblegum");
?>
<p>Welcome to Ye Olde Ice Cream Shoppe. We sell <?php echo count($flavors); ?> flavors of ice cream.</p>
<ul>
<?php foreach($flavors as $flavor) { ?>
<li><?php echo $flavor; ?></li>
<?php> } ?>
</ul>
Honestly i'm pretty sure i didn't miss anything and I've been reviewing this code for over one hour.
Darry Berger
Courses Plus Student 6,818 PointsDarry Berger
Courses Plus Student 6,818 PointsOh wow, i finally found my mistake, i closed the last php tag :S