Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP Build a Basic PHP Website (2018) Listing and Sorting Inventory Items Array Keys

Daniel Harrison
Daniel Harrison
2,944 Points

I am totally lost

Cannot figure out Array Keys 2 part Challenge in the Build a Basic PHP series. Any help would be appreciated

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

I wish I knew what you'd tried that was failing. Because you passed the first step, my gut instinct is to say that maybe you missed the part in the instructions where it said to add open and closed parentheses around the ISBN number. But I really have no idea. Here is the echo line that you need:

 <li><?php echo $book . "(" . $isbn . ")"; ?></li>

Hope this helps! :sparkles:

Daniel Harrison
Daniel Harrison
2,944 Points

Thank you for you prompt reply.

But i did not pass the first step!! Where it asks to modify the foreach .

that is what has me totally confused.

thanks again

Dan

Jennifer Nordell
seal-mask
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Daniel Harrison ah ha! Sorry, I misunderstood. This is the first line you need then:

<?php foreach($books as $isbn => $book) { ?>

:sparkles: