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 trialMUZ140886 Mandava
4,675 Pointsjust failing to pass 4 0f despite doing all the suggested codes
where do i really write $flavor="cookie dough"? i wrote this inside the php code and burmer and try again message keep on coming, i wrote like this $flavor = "cookie dough" echo If(flavor == "cookie dough") also tried removed the previous $flavor variable and placed cookie dough and nothing passed, can someone show me the entire code from challenge 1
<?php
$flavor = "vanilla";
echo "<p>Your favorite flavor of ice cream is ";
echo "vanilla";
echo ".</p>";If($flavor == "cookie dough")
echo "<p>Randy's favorite flavor is cookie dough, also!</p>";
?>
<?php
$flavor="cookie dough";
1 Answer
Paul Johnson
18,924 PointsWhat the task is asking you to do is change the $flavor variable to "cookie dough", so all you have to do is change the first flavor variable to "cookie dough".
Also your second echo command is incorrect, it should be echo $flavor so it displays the value of your flavor variable.
Remember this task is all about variables and conditionals, it is important that you understand why your code is not working before moving on, if you don't understand it you will struggle later on, so it may be worth watching the video again.
So delete this
<?php
$flavor="cookie dough";
and change your $flavor variable to cookie dough.
Also change this
echo "vanilla";
to this
echo $flavor;