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

Morrice Pfeiffer
4,162 PointsCode Challenge Associative Arrays
OK Randy
U got me.
Whats missing?
<h1>The Empire Strikes Back (1985)</h1>
<?php $movie = array("movie");
$movie[title] = "The Empire Strikes Back";
$movie[year] = "1980";
echo $movie["title"];
echo $movie["year"];
?>
Please and Thank you
M
3 Answers

Elliott Frazier
Courses Plus Student 9,647 PointsWhen naming keys you need to wrap the name of the keys in quotation marks. except when using just numbers
Example:
$movie["title"] = "The Empire Strikes Back";
$movie["year"] = "1980";

Morrice Pfeiffer
4,162 PointsD'oh.
Thanks M

Hent Hest van
6,087 PointsI had the exact same problem ;).

Randy Hoyt
Treehouse Guest TeacherAt the end of step 3, the code is supposed to look like this:
<?php
$movie["title"] = "The Empire Strikes Back";
?><h1><?php echo $movie["title"]; ?> (1985)</h1>
<table>
<tr>
<th>Director</th>
<td>Robert Zemeckis</td>
</tr>
<tr>
<th>IMDB Rating</th>
<td>8.5</td>
</tr>
<tr>
<th>IMDB Ranking</th>
<td>53</td>
</tr>
</table>
We are creating an array with information about The Empire Strikes Back in it, and we are replacing the static text that displays the information from Back to the Future with information from this array.
Does that help?

Hent Hest van
6,087 PointsThank you Randy!