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 PHP Arrays and Control Structures PHP Arrays Multidimensional Arrays

Stu Parker
Stu Parker
4,814 Points

Completely baffled

I am om part 3 of multi dimensional array challenge, i have restarted 4 times.. I have used both the concatenation and curly bracket methods in order to output my array values in a <ul>. Both outputs look ths same as the list with hard coded info... Neither is right... Eg

echo "<li>" .  $contacts[0] ['names'] . ":\n" .  $contacts[0]['email'] . "<>\n" ;

And

echo "<li> {$contacts[0] ['names']}  :\n {$contacts[0]['email']}  <>\n" ;

Neither of these are correct in the fashion to allow me to move forward. Would appreciate the correct syntax you are looking for.

fixed code formatting

2 Answers

Stu Parker
Stu Parker
4,814 Points

Turns out it was a matter of spacing around the colon. May i suggest that the error for incorrect submission possibly be more specific, ie expected character missing, as this is not the first time i have been tripped up over white spacing in a code that generally ignores it.

Stu Parker
Stu Parker
4,814 Points

The only bonus, is i can know write and e ho md arrays in my sleep