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
Robbie Thomas
31,093 Pointsassociative arrays challenge 3/7
I have the following:
<?php
$movie = array( "title" => "The Empire Strikes Back", )
?>
<h1><?php echo $movie["title"]; ?>(1985)</h1>
It gives me the red light (ROXANNE!!!!!, Sorry, had to do it) with this:
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.
Help? If you're a Police fan, that would be a plus.
3 Answers
Stone Preston
42,016 Pointsyou might need to put a space after the title in the echo statement in addition to removing the comma at the end of the array
<?php
$movie = array("title" =>"The Empire Strikes Back");
?>
<h1><?php echo $movie["title"]; ?> (1985)</h1>
Petros Sordinas
16,181 PointsI can't remember the challenge, but from what you've posted here, there is a ',' after 'The Empire Strikes Back". It should be
$movie = array("title" =>"The Empire Strikes Back");
Robbie Thomas
31,093 PointsYep, the space. Oy, Programming sucks. Thanks Stone.
Stone Preston
42,016 Pointsno problem
Chris Collier
17,774 PointsChris Collier
17,774 PointsCan you please post the text of the quiz question too?