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

Code Challenge Problem

<?php

$movie = array(); $movie["title"] = "The Empire Strikes Back";

?>

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

Bummer! It looks like the title of the second movie is in the <h1>, but something else isn't quite right. Double-check the parentheses and the year.

What is going on here?

movie.php
<?php

$movie = array();
$movie["title"] = "The Empire Strikes Back";

?>

<h1><?php echo $movie["title"]; ?></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

Erik McClintock
Erik McClintock
45,783 Points

Craig,

The issue here is that the challenge is asking you to do something that seems odd at first; they want you to make sure to leave the year and parenthesis ("(1985)") in the h1 element. Additionally, you need to make sure you leave the space between the movie title and the opening parenthesis, or it will fail out.

You have:

<h1><?php echo $movie['title']; ?></h1>

You need:

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

Make sure you keep an eye open for these kinds of small details for the remainder of the challenge, as they are likely to be present. Hope this helps!

Erik

Thanks mate, you are right the question has not been written well