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!
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
Bart Poelstra2,385 Points
I'm trying to echo mike's name in the output. So I thought: <?php echo $name ?> But that seems incorrect.
Hope someone can help! :)
<?php $name = "Mike"; ?> <?php echo $name ?>
I just took the challenge and passed with this code:
<?php $name = "Mike"; echo $name;
I see a couple of things that might be preventing passing the challenge. Most importantly, you are missing the ; after your echo statement. Second, you do not not need to close and open your php between the variable and echo.
You may notice that I did not close my php. You do not have to close if all the code on the page is php.
Jeff Lemay14,268 Points
This challenge comes up frequently. They want all your code in a single php block (like Ted's answer, although I always close my php no matter what just to be safe).
Your code is "correct", just not what the challenge wants.