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 Build a Basic PHP Website (2018) Listing and Sorting Inventory Items Review Basics

I don't understand the question

I have no ideea what to do... I dont't understand the meaning of the sentences.

output.php
<?php
include("flavor.php");
function get_flavor() {
  return get_flavor() ;

}
echo "Hal's favorite flavor of ice cream is ____.";

?>

1 Answer

The first sentence asks to include the flavor.php file.

include "flavor.php";

The second one points that the function get_flavor is in the flavor.php file, as the file is already included in our current file we just call the function to our output.php file and assign the value to the variable $flavor.

include "flavor.php";
$flavor = get_flavor();

And finally we just display the value of the variable $flavor in our echo statement.

include "flavor.php";
$flavor = get_flavor();
echo "Hal's favorite flavor of ice cream is " . $flavor . ".";