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 trialchannonhall
12,247 PointsSomeone help me please ;-;
The "flavor.php" include file contains a function named get_flavor. That function receives no arguments, and it returns a piece of text as its return value. Call that function and assign the return value to a variable named $flavor.
I need some help I keep failing and failing at this one! Someone know the solution?
<?php
require('flavor.php');
$flavor = get_flavor();
echo "Randy's favorite flavor of ice cream is ____.";
?>
2 Answers
Simon Coates
28,694 Pointsit seems to accept:
<?php
require('flavor.php');
$flavor = get_flavor();
//echo "Hal's favorite flavor of ice cream is $flavor."; //also works
echo "Hal's favorite flavor of ice cream is ".$flavor.".";
?>
(when you just want a solution, you can normally just enter the question into google and it should serve you up forum posts for other treehouse users who were stuck on the same thing.)
Luc de Brouwer
Full Stack JavaScript Techdegree Student 17,939 PointsAs Simon said, you forgot to print out the values you put in the variable. You will probably get an output from the function if you echo it out as mentioned above