PHP Build a Basic PHP Website (2018) Building a Media Library in PHP Variables and Conditionals

what is the answer

of this problem

build a basic php website challenge 3 of 3

1 Answer

Kieran Barker
Kieran Barker
15,000 Points

Hi, 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>.

$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>";

thanks for your quick response; already done the problem.