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 Build a Simple PHP Application Listing Inventory Items More Excitement With Arrays

Andrew Lyon
Andrew Lyon
3,901 Points

php code challenge problem

I've checked my code against what I've got from the lesson, including my own files, and I can't find out what is wrong with it!

<?php
$flavors = array("Chocolate","Vanilla","Strawberry");
?>
<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>

2 Answers

<?php foreach($flavors as $flavor); { ?> 

Remove the semicolon after the foreach closing brantasy

Andrew Lyon
Andrew Lyon
3,901 Points

Thanks Muhammad - such a small detail but makes all the difference!

Your welcome, And yes it is xD.