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 trial

PHP

PHP Task 4 problem

I am stuck on the very last task question on PHP where it asks to; "Change the value in the flavor variable to cookie dough".

Well... I've tried typing in:

cookie dough cookiedough 'cookie dough' 'cookiedough' "cookie dough" "cookiedough"

But NOTHING works....

My code for Task 3 that passes is:

<?php

$flavor = "vanilla'; echo "<p>Your favorite flavor of ice cream is "; echo "$flavor"; echo ".</p>"; echo "<p>Randy's favorite is <?php if ($flavor == cookie dough), also!</p>";

?>

For Task 4 my code is:

<?php

$flavor = "cookie dough"; echo "<p>Your favorite flavor of ice cream is "; echo "$flavor"; echo ".</p>"; echo "<p>Randy's favorite flavor is <?php if (flavor == cookie dough), also!</p>";

?>

Please, please help me - I really don't know what else to do... :(

I GOT I!!!!!

<?php $flavor = "cookie dough"; echo "<p>Your favorite flavor of ice cream is $flavor"; echo ".</p>"; if ($flavor == "cookie dough"){ echo "<p>Randy's favorite flavor is cookie dough, also!</p>"; } ?>

OOPS... I forgot the if statement... my bad.

2 Answers

(flavor == cookie dough):

(flavor == "cookie dough")

Hi Yordi, I managed to get it to work but thanks anyway !!