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 Enhancing a Simple PHP Application Adding Search: Controller & View Accounting for Empty Results

Kenneth Jones
Kenneth Jones
6,656 Points

Accounting for empty results challenge

Hello,

I am struggling with this challenge, I keep getting Bummer! Try Again! I have read that this means my php is invalid, however I have pasted my code into my text editor and it seems ok. Any suggestions would be appreciated.

Here is my code:

    <?php 
      if (!empty($recommendations) {
        echo '<ul>';
             foreach ($recommendations as $flavor) {
                echo '<li>' . $flavor . '</li>';
             }
        echo '</ul>';
      } 
    ?>

1 Answer

Kenneth Jones
Kenneth Jones
6,656 Points

I started to see if I could build it up from the basics, I removed all of my code, leaving just the h1 tag, clicked check work and it told me I was successful!