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.
Sebastian Popa11,094 Points
Can i get the code for this code challenge ?
I need the code that makes this challenge work.
<?php //edit this array $contacts = array('Alena Holligan', 'Dave McFarland', 'Treasure Porth', 'Andrew Chalkley'); echo "<ul>\n"; //$contacts will return 'Alena Holligan' in our simple array of names. echo "<li>Alena Holligan : email@example.com</li>\n"; echo "<li>Dave McFarland : firstname.lastname@example.org</li>\n"; echo "<li>Treasure Porth : email@example.com</li>\n"; echo "<li>Andrew Chalkley : firstname.lastname@example.org</li>\n"; echo "</ul>\n";
Jason AndersTreehouse Moderator 145,631 Points
Hi again :)
You're on the right track in that the task wants individual arrays, but the arrays should all be inside the first array, instead of each being assigned to its own variable (so creating a multi-dimensional array).
So, you pretty much have all the correct syntax, the arrays need to me moved into one, like this:
$contacts = array( array('name' => 'Alena Holligan'), array('name' => 'Dave McFarland'), array('name' => 'Treasure Porth'), array('name' => 'Andrew Chalkley') );
Hope this helps.