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 trialRafael Medina
6,706 PointsI dont know whats wrong here!
<?php $flavor = "cookie dough"; if ($flavor == "vanilla"){ echo "<p>Your favorite flavor of ice cream is "; echo "vanilla"; echo ".</p>"; }
if ($flavor == "cookie dough"){ echo "<p>Randy's favorite flavor is cookie dough, also!</p>"; } ?>
2 Answers
Shawn Gregory
Courses Plus Student 40,672 PointsHello,
What the challenge is looking for is to see what kind of ice cream you like (the flavor variable) and test to see if your flavor is the same as Randy. Instead of two IF statements, why don't you try an IF...ELSE block. Remember, you are testing to see if your flavor matching that of Randy so you need to set a condition in the IF block to check for that. After that you need to put the proper statements in their proper places. And remember what step two is asking you to do. If you do these things, the challenge should pass for you. Good luck.
Cheers!
Rafael Medina
6,706 PointsYou were right.
Thanks for the help!