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

I'm confused about why this isn't passing.

I have no idea why this isn't passing. I'm pretty sure it's something simple but I'm missing it. These are the instructions:

"Next, let’s move the flavors array into that function. This task has two steps. (1) Move the code that creates the flavors array from index.php into the get_all_flavors() function in flavors.php. (2) Add code at the end of the function so that it returns the array of flavors back to whatever code calls it."

<?php

// MODEL FILE function get_all_flavors() { $flavors = array( "Jalapeno So Spicy", "Avocado Chocolate", "Peppermint", "Vanilla", "Cake Batter", "Cookie Dough" );

return = $flavors; } ?>

3 Answers

adamdonatello
adamdonatello
27,485 Points

Hi Sarah!

The only thing I can see is that on your return statement you have included a "=" sign which I don't think is required. I Hope this helps :)

<?php
function get_all_flavors() { 
$flavors = array( "Jalapeno So Spicy", "Avocado Chocolate", "Peppermint", "Vanilla", "Cake Batter", "Cookie Dough" );
return $flavors; 
} 
?>

I knew it would be something simple! I always miss the "=".

Thanks!

return = $flavors; } ?>

= assigns a variable in php. You just want to return $flavors.