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 trialKitisak Huaynuy
9,120 PointsI don't pass the test.
I don't pass the test. I don't understand, somebody help me please?
Challenge task 4 of 4 Change the value in the flavor variable to cookie dough. Preview the code and make sure the message appears.
<?php
$flavor ="Chocolate";
echo "<p>Your favorite flavor of ice cream is ";
echo $flavor;
echo ".</p>";
if ($flavor =="vanila"){
echo "<p>Randy's favorite flavor is cookie dough, also!</p>";
}
if ($flavor =="Chocolate"){
echo "cookie dough";
}
?>
```
Kitisak Huaynuy
9,120 PointsThank you for you instructions.
6 Answers
Sean T. Unwin
28,690 PointsHi, Kitisak Huaynuy. You added another if
statement. You only need to change the value of the variable.
$flavor = "cookie dough";
Also, task 3 has you add an if
statement to check whether $flavor
is equal to "cookie dough"` and you have "vanilla"
Ryan Duchene
Courses Plus Student 46,022 PointsBasically, you want to display the second sentence ("Randy's favorite flavor is cookie dough, also!") only if your favorite flavor is cookie dough. Remember, $flavor
is your favorite flavor.
So, if
your favorite $flavor
is equal to "cookie dough"
, then it should echo
out that Randy's favorite flavor is cookie dough, also!
.
jason fenley
256 Pointsdu får det nästa gång
jason fenley
256 Pointsdu får det nästa gång
jason fenley
256 Pointsdu får det nästa gång
Kitisak Huaynuy
9,120 Pointsthank you everybody, I will follow the recommend.
Ryan Duchene
Courses Plus Student 46,022 PointsRyan Duchene
Courses Plus Student 46,022 PointsFor ease of readability...
If you want to know how I did that, check out the Markdown cheatsheet.