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 trialJorge Gonzalez
3,574 PointsFor challenge 2, this does not work. :
Why does nothing echo?
<?php
$name = "Mike";
?>
<!DOCTYPE html>
<p> <? php echo $name ?></p>
4 Answers
Pedro Cabral
Full Stack JavaScript Techdegree Student 23,916 PointsTry removing the space:
<?php echo $name; ?>
Jorge Gonzalez
3,574 PointsWow guys. Thank you Ted and Pedro for the prompt response!
Pedro Cabral
Full Stack JavaScript Techdegree Student 23,916 PointsTed Sumner, the issue is "a space" as I mentioned and that's not to be confused with "white space". If you look closely to the second time he opens his php tag you will notice he brakes it by inserting a space between the question mark and the letter p and that's the reason why its not getting parsed/rendered. That aside, your code provides the optimal answer to the challenge.
Ted Sumner
Courses Plus Student 17,967 PointsI see what you mean now. I don't know that what he wrote will pass even if it is otherwise correct.
Ted Sumner
Courses Plus Student 17,967 PointsThe white space is not the issue. You have more code than the challenge asked for. This passed for me:
<?php
$name = "Mike";
echo $name;