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
Maria Brooks
3,776 PointsRefactoring 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
Holger Liesegang
50,595 PointsHi Maria, what is the question of this challenge?
Maria Brooks
3,776 PointsHolger,
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
Holger Liesegang
50,595 PointsThank 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.
Maria Brooks
3,776 PointsSorry, I'm still new to Treehouse and posting on the forum.
Here is the URL:
Holger Liesegang
50,595 PointsYou were nearly right :-)
echo "<li>" . $flavor["name"] . " +" . $flavor["likes"] . "</li>";
you just forgot the . before the last <li> tag
Maria Brooks
3,776 PointsAhh....I was sooooo close!!
Thanks so much....awesome support!
ALAINE CRISTINE DE MEIRA
8,601 PointsThank you, I was stuck too
Holger Liesegang
50,595 PointsYou're welcome, ALAINE CRISTINE DE MEIRA :)