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.

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