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 trialpatrik matheson
1,879 Pointsmake the message disappear how?
This question says to make the message disappear if the conditional returns true. What does it mean? I have tried a few things. just not giving it the answer it wants.
patrik matheson
1,879 PointsBasically this
$flavor = "cookies and cream"
echo 'My favorite ice cream is' . $flavor;
if ($flavor == "cookie dough."){ echo "wow we like the same kind of cookies"; }else{ //missing some magic disappear code }
1 Answer
Stone Preston
42,016 Pointsyour conditional is correct, however you dont need to modify the string that goes inside the conditional. Leave it as what it was in the beginning.
if ($flavor == "cookie dough") {
echo "<p>Randy's favorite flavor is cookie dough, also!</p>";
}
All it says and that you need to make sure the paragraph that says "Randys favorite flavor is cookie dough, also!" is only present when your flavor variable = cookie dough as well, you dont actually have to write any code to make it disappear, the conditional takes care of that for you.
Stone Preston
42,016 PointsStone Preston
42,016 Pointswhat code have you tried?