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

what is wrong with my code any one to help me to solve this problem

p

movie.php
<?php 
$movie = array();
$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>

5 Answers

Hugo Paz
Hugo Paz
15,622 Points

Hi Abdi,

You have an extra space after the year.

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

oh thanks i got it

Shawn Flanigan
PLUS
Shawn Flanigan
Courses Plus Student 15,815 Points

It looks like you're stuck on step 3, is that correct? If so, the only potential problem I see is a space after the year, before the closing h1 tag.

Does that help?

it is ignoring a space between semicolon and the closing php tag

don't know why any one knows the explanation

Shawn Flanigan
Shawn Flanigan
Courses Plus Student 15,815 Points

The space in the php is never rendered to the browser, so it doesn't really matter. You can do stuff like this with php and you'll still pass as long as nothing is being output:

<h1><?php echo $movie["title"]; /* This comment is just a bunch of garbage. */ $favoriteNumber = 7; ?> (1985)</h1>