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!
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
Edd Figueiredo
2,268 PointsCode Challenge Variables and Conditions - Final Challenge
I keep getting bummer in the end... If I simply change my $flavor to "coockie dough" the past tasks no longer pass.
I'm doing exactly what the task is asking to do... Don't know what to do anymore, I'm working on this exercise for two days now.
I'm here:
$flavor = "chocolate";
echo "<p>Your favorite flavor of ice cream is ";
echo $flavor;
echo ".</p>";
if ($flavor == "coockie dough"){
echo "<p>Randy's favorite flavor is cookie dough, also!</p>";
}
?>```
If I change $flavor to "coockie dough" at the beginning, the previous task no longer pass. And that's exactly what's being ask to do =- P
I tried this already;
```<?php
$flavor = "coockie dough";
if ($flavor == "chocolate"){
echo "<p>Your favorite flavor of ice cream is ";
echo $flavor;
echo ".</p>";
}
if ($flavor == "coockie dough"){
echo "<p>Randy's favorite flavor is cookie dough, also!</p>";
}
?>```
I didn't work ...........
2 Answers

Jeff Busch
19,287 PointsHi Edd,
Almost there. Change the first example.
<?php
$flavor = "cookie dough";
// Instead of
if ($flavor == "coockie dough"){
// Try
if ($flavor == "cookie dough"){
?>
Jeff

Janelle Smith
5,824 PointsHello, You have to make some minor corrections with the syntax. Please see below. <?php $flavor = "cookie dough"; if ($flavor == "chocolate"){ echo "<p>Your favorite flavor of ice cream is " . $flavor . "</p>"; } if ($flavor == "cookie dough"){ echo "<p>Randys favorite flavor is cookie dough, also!</p>"; } ?>