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 Build a Simple PHP Application Integrating with PayPal Array Keys

the preview displays as it should if iam not wrong and still can not pass the challenge

asking me to view all the list items on this format "Book title (isbn) " i am viewing it and it looks legit but still can not pass the challenge here is my code

<?php foreach($books as $isbn => $book) { ?>
            <li><?php echo $book . "\n" . "(" . $isbn . ")"; ?></li>
        <?php } ?>

1 Answer

never mind , solved had to do it this way

<?php echo $book; ?> (<?php echo $isbn; ?>)

Hi Mohamed,

I think the string concatenation would have worked like this:

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

Rather than a line return you want to make sure there's a space after the book.

Perhaps your solution is more readable though.

Hi Jason , i tried your code but yet did not work , tho i have seen another post on the forum suggesting the same solution .. got no clue why it did not work with me really

Hi Mohamed,

Not sure why the string concatenation is not working for you.

I have just passed with all of the following:

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

or

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

or

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