Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP Enhancing a Simple PHP Application Integrating Validation Errors Reviewing PHP Basics

Sajid Latif
seal-mask
.a{fill-rule:evenodd;}techdegree
Sajid Latif
Full Stack JavaScript Techdegree Student 22,368 Points

Return value. I think I need som { } somewhere...

Return value. I think I need som { } somewhere...

output.php
<?php
include("flavor.php");
$flavor = return $get_flavor;
echo "Randy's favorite flavor of ice cream is ____.";

?>

2 Answers

Paolo Scamardella
Paolo Scamardella
24,828 Points

It should be $flavor = get_flavor();

No need to add return since in the function it is already returning a value. Also, get_flavor is a function, so you need to add () to the end of it and no $ in front of it. It is a function, not a variable.

Variable = $name Function/Method = function_name() // calling the function/method