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 trialPaul Kirsch
2,894 Pointsstill no luck on this one
Hi, task 5 I have tried code from the forum and I can't get this to pass. any suggestions?
<?php $movie = array( "title" => "The Empire Strikes Back", "year" => "1980" ); ?>
<h1><?php echo $movie["title"];?>(<?php echo $movie["year"];?>) </h1>
//not sure why it seems to cut off my angle bracket h1 angle bracket in this forum. It is there when I enter text in the forum box
4 Answers
Jason Anello
Courses Plus Student 94,610 PointsIt looks like you've lost the space between the movie and the year.
<h1><?php echo $movie["title"]; ?> (<?php echo $movie["year"]; ?>)</h1>
There's a space before the left parenthesis.
Paul Kirsch
2,894 PointsJason, Thanks for the link to presenting code on-line. Very valuable. I will try what you have suggested.
Paul Kirsch
2,894 PointsHey Jason, you're an Einstein! It worked! Yippie! Hooray! Wahoo! didn't know space was so critical- wondering if it is just these lessons or all PHP. Best, P.
Jason Anello
Courses Plus Student 94,610 PointsIt's not a php thing. It doesn't matter to php whether there's a space there or not. Your code didn't have an error in it.
The space is there for us to make it easier to read.
The original output from the h1 was Back to the Future (1985)
When you added in the echo statements you didn't preserve that space between the movie and left parenthesis before the year.
Your output would have been The Empire Strikes Back(1980) with no space between the movie and year. Making it a little harder to read.
I think the code challenge is simply making sure you preserved that space when adding in your echo statements.
Paul Kirsch
2,894 PointsRight, thanks for clarifying.
Jason Anello
Courses Plus Student 94,610 PointsJason Anello
Courses Plus Student 94,610 PointsHi Paul,
The forum will strip out html.
Here's some tips on how to post code in the forums.
https://teamtreehouse.com/forum/posting-code-to-the-forum