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 trialAnthony Gomez
Full Stack JavaScript Techdegree Student 10,089 PointsCant Solve this challenge
This is what i have to do:
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.)
And this is the code i have...
<?php
$movie = array(
"title" => "The Empire Strikes Back"
);
?>
<h1><?php echo $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>
keeps telling me to check the () and the Year but i havent make any changes to it, and even if i create a new element inside the array something like "year" => 1985 and try to echo it inside the () keep getting error.
9 Answers
Dario Morbidi
33,072 PointsFirst i would close the php statement with "?>". Maybe it helps.
Anthony Gomez
Full Stack JavaScript Techdegree Student 10,089 Pointswell i jsut fast write it and not all of the code show but the point is that i do an Echo with the title of the movie and keeps asking to check the () and the year.
Dario Morbidi
33,072 PointsPress link Markdown Cheatsheet: so you will know how to show correctly the code, and i can try to help you.
Anthony Gomez
Full Stack JavaScript Techdegree Student 10,089 Points<?php
$movie = array(
"title" => "The Empire Strikes Back"
);
?>
<h1>Back to the Future (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>
Anthony Gomez
Full Stack JavaScript Techdegree Student 10,089 Pointsthx for the tip with the "Markdown Cheatsheet"
Dario Morbidi
33,072 PointsOk, should be simple. Post your solution, so i can check.
Anthony Gomez
Full Stack JavaScript Techdegree Student 10,089 Pointsim on it.
Dario Morbidi
33,072 PointsYes write me how you try to solve the challenge. Write here give your solution.
Anthony Gomez
Full Stack JavaScript Techdegree Student 10,089 PointsOut of no were it seems i did it right this time :| this is what i did and im 100% sure that i was doing it like that before...
<?php
$movie= array(
"title" => "The Empire Strikes Back"
);
?>
<h1><?php echo $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>
Dario Morbidi
33,072 PointsOk it looks correct.
Check your first post, maybe is different the code you showed. Post it again (but with code visible ;) ) so we can compare.
Anthony Gomez
Full Stack JavaScript Techdegree Student 10,089 Pointsi no longer have the original or first sorry :P, but still thanks a lot somehow i manage to do it right this time.
Dario Morbidi
33,072 PointsYou wrote here in the forum in the first post, just was not so visible: for example i didn't see the closing php statement "?>".
But never mind, im happy you solved.