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 trialAnthony Schleich
3,588 PointsAny help would be appreciated. Stage 5 of Building a Simple PHP Application - Code Challenge.
If anyone can just solve for me that would be perfect. Having trouble wrapping my head around this. I may need a nap.
2 Answers
Taylor Plante
22,283 PointsHi Anthony,
Here is what I got inside the loop, this includes parts 1 and 2:
<?php foreach($books as $isbn => $book) { ?> <li><?php echo $book . ' (' . $isbn . ')'; ?></li> <?php } ?>
First you create the working variable $isbn within the foreach setup, then you concatenate the first space to a parenthesis using quotations, followed by your newly defined $isbn, then your closing parenthesis. Hope that helps!
Anthony Schleich
3,588 PointsThanks, I actually went through everything again, and I got it correct. Just like what you wrote.