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 Build a Simple PHP Application Listing Inventory Items Associative Arrays

Challenge Task 3 of 7

In this step I really didn't (for 15 minutes) get what exactly I have to add ( which "year" and "parentheses" ). Does it mean to add parentheses in key-element, or year of present?! It's not so logical to add year of release like a string:/ May be I'm too silly or can't understand obvious stuff (and have never seen this awesome movie - may be this is the thing) but my personal opinion - this task set not so straight, as always in Treehouse.

p.s. the task I have done at random. By the method of 'tyka' lol p.s p.s I'm very like this project <3

movie.php
<?php
$movie=array(
'title'=>"The Empire Strikes Back"
);
?>
<h1><?php echo $movie[title]." (1980)"; ?></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>

1 Answer

Hi,

Lines 1 - 7 of your file should look something like this part 3:

<?php
  $movie = array(
    "title" => "The Empire Strikes Back"
  );
?>

<h1><?php echo $movie["title"]; ?> (1985)</h1>

Part 5 then mentions the year as you have mentioned so this would become:

<?php
  $movie = array(
    "title" => "The Empire Strikes Back",
    "year" => 1980
  );
?>

<h1><?php echo $movie["title"]; ?> (<?php echo $movie["year"]; ?>)</h1>

Hope I've not misunderstood.

-Rich