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 trialBryce Weaver
9,299 PointsThe array below contains a list of books. Each element in the array has the book’s title as its value and the ISBN as it
I've been on this one for a couple days now. Really confused! If someone wouldn't mind helping me that would be awesome!
1 Answer
Shawn Gregory
Courses Plus Student 40,672 PointsHello,
They are asking you to modify the foreach() loop to include the array keys and then take that array key and put it into a variable called $isbn. Remember, you can use a foreach loop one of two ways: foreach($array as $value) and foreach($array as $key => $value). Once you allow to loop to use the array key, just assign it to the variable $isbn or if you named the array key in the loop $isbn, just add another $ to the front of it like so: $$isbn. Hope I helped you enough for you to get it without giving you the direct answer.
Cheers!