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 trialAbdullah -
130 Pointswhat is the answer
of this problem
build a basic php website challenge 3 of 3
1 Answer
Kieran Barker
15,028 PointsHi, Abdullah!
Like the challenge says, the last sentence...
Hal's favorite flavor is cookie dough, also!
...Only makes sense if your $flavor
variable contains the same string, cookie dough
.
So, you need to say:
If my $flavor
variable contains the string cookie dough
, then print out <p>Hal's favorite flavor is cookie dough, also!</p>
.
<?php
$flavor = "mint choc chip";
echo "<p>Your favorite flavor of ice cream is ";
echo $flavor;
echo ".</p>";
if ($flavor === "cookie dough") {
echo "<p>Hal's favorite flavor is cookie dough, also!</p>";
}
?>
Abdullah -
130 PointsAbdullah -
130 Pointsthanks for your quick response; already done the problem.