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

Struggling 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!

index.php
<?php
//edit this array
$contacts = array(
  array(
  'name' => 'Alena Holligan',
  ),
  array(
  'name' => 'Dave McFarland',
  ),
  array(
  'name' => 'Treasure Porth',
  ),
  array(
  'name' => 'Andrew Chalkley',
  )
  );

Did you delete all the rest of the starter code?

Yeah, 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?

So 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

In 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.