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

problem with code on challenge 3 of 7 (Associative Arrays)

By the end of this code challenge, we'll REMOVE from the page all the information about the original movie ("Back to the Future") and REPLACE it with information about the new movie ("The Empire Strikes Back"). Right now, the <h1> element has the title of the original movie as a static piece of text. Replace that with a PHP command that INSTEAD displays the title of the new movie from the array. (Be sure to leave the <h1> tags, the parentheses, and the year intact. Here is my code: <?php $movie["title] = "The Empire Strikes Back"; ?> <h1 echo $movie["title"]; (1985) ?></h1>

2 Answers

Hey Hi,

You have to also assign the value of the array to the H1 tag:

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

This will replace the static text with the value in the Array...

Your right! sometimes when they teach you in the tutorial videos, its not "let say" quite the same. Some what different. In fact I had challenges before that I never could understand, so I would skip the challenge and move on to watch a video and BAM! they show the answer. I know that every person has a unique teaching style, but as they say "never give up!"