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 trial

PHP

can 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

Make 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();
?>

thanks a lot I got it

$flavor = get_flavor();

Thanks Randy i got it $flavor = get_flavor();

Randy Hoyt
STAFF
Randy Hoyt
Treehouse Guest Teacher

You 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?

need help plz

This helped me out a ton. Thanks Randy!

Martina Carrington
Martina Carrington
15,754 Points

i 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 ____.";

?>