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

Refactoring Code Base - Separate Concerns Code Challenge (4 of 4)

Having problems getting the last challenge.

I tried these 2 options but neither work:

echo "<li>" . $flavor["name"] . " " . "+". $flavor["likes"] "</li>";

echo "<li>" . $flavor["name"] . " +". $flavor["likes"] "</li>";

I'm sure it's something simple....I'm just not seeing it!

Regards, Maria

7 Answers

Hi Maria, what is the question of this challenge?

Holger,

Sorry I didn't realize you needed that as well. Here it is:

Instead of showing just the flavor name (“Cookie Dough”), change it to show the flavor name, followed by a space, followed by a plus sign, followed by the number of likes (“Cookie Dough +976”). (Look through [flavors.php] to see the structure of the flavors array and to figure out how to access the number of likes.)

Regards, Maria

Thank you and sorry as I need the flavors.php to answer your question - would you mind please giving me the URL to this challenge, too :-)

Then I'll be able to just go thru the challenge for you.

Sorry, I'm still new to Treehouse and posting on the forum.

Here is the URL:

http://teamtreehouse.com/library/enhancing-a-simple-php-application-2/refactoring-the-codebase/separating-concerns-mvc

You were nearly right :-)

            echo "<li>" . $flavor["name"] . " +" . $flavor["likes"] . "</li>";

you just forgot the . before the last <li> tag

Ahh....I was sooooo close!!

Thanks so much....awesome support!

Thank you, I was stuck too

You're welcome, ALAINE CRISTINE DE MEIRA :)