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 trialAminu Tijani
7,944 PointsKeeps saying I am wrong
I have written the right code but keeps telling it'snot right.
Please assist.
<?php
$recommendations = array();
?><html>
<body>
<h1>Flavor Recommendations</h1>
<?php if(!empty($recommendation)){
echo '<ul>';
foreach($recommendations as $flavor) {
echo '<li>$flavor</li>';
}
echo '</ul>';
} else {
echo '<p>There are no flavor recommendations for you</p>';
}
?>
</body>
</html>
1 Answer
Mike Costa
Courses Plus Student 26,362 PointsI just tested this out and your code looks correct, however, it looks like the code interpreter is a stickler for exactly what it's asking. In the quiz question, it asks you to add a paragraph tag, and inside of that add exactly what is inside the quotes (the period included) and it should pass.
Aminu Tijani
7,944 PointsAminu Tijani
7,944 PointsIt works. I omitted the period at the end of the text.
Thanks a lot