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 trialRossouw Strydom
12,398 Pointscan someone help me i dont know what im i doing wrong?
<?php
$include("flavor.php");
get_flavor(){
return =flavor;
};
echo "Randy's favorite flavor of ice cream is ____.";
?>
7 Answers
Joseph Damiani
1,066 PointsMake sure you add the code after the sentence.
<?php
$file = include('flavor.php');
echo "Randy's favorite flavor of ice cream is $file.";
$flavor = get_flavor();
?>
Rossouw Strydom
12,398 Pointsthanks a lot I got it
$flavor = get_flavor();
Felix Timothy
3,064 PointsThanks Randy i got it $flavor = get_flavor();
Randy Hoyt
Treehouse Guest TeacherYou call a function and load its return value into a variable like this:
$number = count($books);
This code calls the count
function (passing in one argument), and it loads the return value into a variable called number
.
Does that help?
Rossouw Strydom
12,398 Pointsneed help plz
Bryan Knight
34,215 PointsThis helped me out a ton. Thanks Randy!
Martina Carrington
15,754 Pointsi am having the same problem with this <?php $include("flavor.php"); $flavor = get_flavor();{ return =flavor; }; echo "Randy's favorite flavor of ice cream is ____.";
?>