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

Please Help

I have this challenge: "The static HTML below displays information about one really great movie. In this code challenge, we'll modify this so that it INSTEAD displays information about an even better movie; we'll also modify it to use an associative array in PHP instead of static pieces of text. First, add a PHP code block above the HTML that creates an empty PHP array named movie." The code is this: <h1>Back to the Future (1985)</h1> <table> <tr> <th>Director</th> <td>Robert Zemeckis</td> </tr> My answer is this but It's not correct. Any suggestion what I'm doing wrong? <?php $movie = array(); <h1>Back to the Future (1985)</h1> <table> <tr> <th>Director</th> <td>Robert Zemeckis</td> </tr> ?>

Thanks for the help

4 Answers

Navid Mirzaie Milani
Navid Mirzaie Milani
6,274 Points

ed quijano , you making the array but don't fill it;).

<?php 
   $movie = array("he code is this: Back to the Future (1985) Director Robert Zemeckis ");
  //print array 
  print_r($movie); //this should print the array with the text: he code is this: Back to the Future (1985) Director Robert Zemeckis  in it. 
?>

goodluck!

thanks

Navid Mirzaie Milani
Navid Mirzaie Milani
6,274 Points

just accept this answer so others don't need to reply on it.

Thanks for your help

Navid Mirzaie Milani
Navid Mirzaie Milani
6,274 Points

your welcome, glad i could help but can you accept the answer in the above example i gave you? this prevent others to help you again while there's already a solution.