Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP

Variable and Conditionals code challenge

Hi,

I'm stuck at task 4 in the code challenge. I change the variable on line 2 to "cookie dough" and I'm still getting an error that this is incorrect. My code is below. I can't figure out where I'm going wrong with this. It seems simple enough; just change the variable, but it doesn't work. I do get the desired result though. Both lines are echoed out as such:

Your favorite flavor of ice cream is cookie dough. Randy's favorite flavor is cookie dough, also!

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

?>

3 Answers

I ended up going back and starting all over and this time I had no issues. I still don't see what I did differently.

Christopher Crowd
Christopher Crowd
3,333 Points

Once in awhile the code challenges will bug out and not work correctly. I have issues once and awhile as well so usually i just refresh the page.

Good to know Christopher. Thanks.