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

[SOLVED] any one to help me to solve don't understand what is the problem is

php

flavors.php
<?php

    $flavors = array("Chocolate", "Vanilla", "ice cream");

?>
<p>Welcome to Ye Olde Ice Cream Shoppe. We sell <?php count ($flavors); ?> flavors of ice cream.</p>
<ul>
    <li><?php echo $flavor1; ?></li>
    <li><?php echo $flavor2; ?></li>
</ul>

2 Answers

thanks but that is not the case i already got the answer I forgot to type echo before the count function

Not that familiar with PHP, but since you're using an array, i think you may have to use an index number to reference the flavors inside the flavors array.

For eg.

 <li><?php echo $flavors{0}; ?></li>```

and so on, you'll have to add these numbers inside the curly braces,
0 - Chocolate
1 - Vanilla
2 - ice cream

I hope this helps, i apologize if this is incorrect.