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

Separating Concerns: Code Challenge

Challenge task 1 of 3 This code creates an array of ice cream flavors and then displays them in an index.php file. However, we now also need the array of ice cream flavors in another file. Let's move the flavors array into a model file. First, in flavors.php, create a new function called get_all_flavors().

This is what I am doing in the flavors.php. But it is not working, what am I missing?

<?php

function = get_all_flavors() {

}

?>

3 Answers

alex mattingley
alex mattingley
7,508 Points

I'm a little rusty on php but try this:

<?php

function get_all_flavors() {

}
?>

Thank you. It's amazing that little "= " sign threw it off. But I could not figure that out on my own. Ha ha.

alex mattingley
alex mattingley
7,508 Points

PHP is crazy sensitive. When I was first learning, I was doing a challenge that I thought I had right, but it kept giving me error messages. I finally asked for help, and my code was not being executed because I was missing a single space.