PHP Build a Basic PHP Website Listing and Sorting Inventory Items Associative Arrays

Cliff Jackson
Cliff Jackson
2,886 Points

Code will not pass challenge??

Cannot get the code to pass, second time i've posted the problem any ideas?

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

2 Answers

Jennifer Nordell
MOD
Jennifer Nordell
Treehouse Moderator

Hi there! While PHP isn't terribly picky about whitespace this is one of those "make or break" cases and, in this case, it is breaking your code. You have an extraneous space between $movie and ["title"] removing the space between these two causes the code to pass Step 3 of the challenge.

Hope this helps! :sparkles:

Cliff Jackson
Cliff Jackson
2,886 Points

Thanks Jennifer spot on as always.