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 Basic PHP Website (2018) Listing and Sorting Inventory Items Associative Arrays

I have been on this task forever does anybody know the solution to the final step 7/7? Please Help!!!

The question ask to replace the three "td" tags that displayed the information of the old movie with information from the new movie "The Empire Strikes Back"

index.php
<?php

$movie = array(
 "title" => "The Empire Strikes Back",
 "year" => 1980
  );
$movie["director"] = "Irvin Kershner";
$movie["imdb_rating"] = 8.8;
$movie["imdb_ranking"] = 11;
$movie["year"] = 1980;
?> 

<h1><?php echo $movie["title"]; ?> <?php echo $movie["year"] ?> </h1>
<h1>Back to the Future (1985)</h1>

<table>
  <tr>
    <th>Director</th>
    <td></td>
  </tr>
  <tr>
    <th>IMDB Rating</th>
    <td>8.5</td>
  </tr>
  <tr>
    <th>IMDB Ranking</th>
    <td>53</td>
  </tr>
</table>

2 Answers

Greg Kaleka
Greg Kaleka
39,021 Points

Hi Justin,

You just need to do for the <td> tags exactly the same thing you did for the first <h1> tag: echo out the values for Director, IMDB Rating and IMDB Ranking. Here's how the first one will look - you can figure out the rest:

<?php

<table>
  <tr>
    <th>Director</th>
    <td><?php echo $movie["director"];?></td>
  </tr>
  <tr>

Cheers :beers:

-Greg

David Kaneshiro Jr.
David Kaneshiro Jr.
29,247 Points

In between the <td> tags you'll want to echo out the appropriate values stored in the $movie array.