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 trialA X
12,842 PointsStruggling to Know What Specifically is Wanted with Part 1 of the Multi-Dimensional Array Challenge
Many have written about this challenge, and I've tried various versions of people's answers for part 1, but all have resulted in an error message " I do not see the required output. You should not be modifying the output at this point."
What am I missing that's causing this code challenge to fail? Is it that I'm using parens instead of brackets? Is it the variable name that's the issue? Or is it something else? Thanks for your help!
<?php
//edit this array
$contacts = array(
array(
'name' => 'Alena Holligan',
),
array(
'name' => 'Dave McFarland',
),
array(
'name' => 'Treasure Porth',
),
array(
'name' => 'Andrew Chalkley',
)
);
A X
12,842 PointsYeah, I deleted the starter code because that's not needed in the process....right? We're making a multi-dimensional array with the info that was in the echos right?
A X
12,842 PointsSo as a comment to you all, the code above does pass Part 1 of the challenge, but you need to keep the echos in and unaltered in order to pass...otherwise this will fail. Thanks for Jason's clarification!
1 Answer
Jason Anello
Courses Plus Student 94,610 PointsIn task 1 and 2 you're supposed to be building up an array with the info that is in the echo statements but you have to keep all that output there while you're doing that. The challenge tester is checking to make sure the output is still there and you haven't made any changes to it.
The ultimate goal in task 3 is to replace all the hard coded names and emails in the output with the array values you created in tasks 1 and 2.
Jason Anello
Courses Plus Student 94,610 PointsJason Anello
Courses Plus Student 94,610 PointsDid you delete all the rest of the starter code?