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
Mark Sherrill
7,343 PointsPHP > Associative Arrays / code challange 3/7
Where is the second movie in the array that we are to display - confused. I've add a second movie, but that must be wrong.
Here is my code, but not really sure if this is what your asking for. Thanks.
<?php
$movie = array(
"title" => "The Empire Strikes Back",
"second movie" => "\"Back to the Future\" (1985)"
);
?>
<?php echo "<h1>" . $movie["second movie"] . "</h1>"?>
4 Answers
Mark Sherrill
7,343 Pointssome of my code is not displaying. In the second php block, there should be the opening and closing h1 tag between the quotes. Thanks Mark
Randy Hoyt
Treehouse Guest TeacherSorry for the confusion! When the code challenge starts, the file shows information for one movie: Back to the Future. Throughout the code challenge, we change it to show information about a different movie: The Empire Strikes Back.
Throughout the code challenge, I refer to Back to the Future as "the first movie" and The Empire Strikes Back as the second movie.
You aren't supposed to show information about two movies at the same time. The file will only ever show information for one movie. I'll take a look at re-wording the question to clarify this.
Does that help?
Randy Hoyt
Treehouse Guest TeacherThe code should just look like this after the step you are on:
<?php
$movie = array(
"title" => "The Empire Strikes Back"
);
?>
<h1><?php echo $movie["title"]; ?> (1985)</h1>
Mark Sherrill
7,343 PointsThanks Randy. I just had the wrong movie. I move through the lessons as I have some free time, so I didn't remember the first, second movie reference in the previous task. It would be helpful to have all of the info needed in the code or in the directions. Thanks again, you do a great job!