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 trialJaimee Williams
176 PointsWhat is wrong with this code?
Why is the output not accepting the correct answer?
<?php
$name = "Mike";
?>
<<?php echo $name ?>
6 Answers
geoffrey
28,736 PointsYou have added an extra character (<) before the second php part.
<?php
$name = "Mike";
echo $name;
?>
Otherwise what you did is right as well, except for the extra character as I mentioned.
Abe Layee
8,378 PointsYou have to pass the variable to the echo. Something like this
<?php
$name = "Mike";
echo $name;
?>
Jaimee Williams
176 PointsI did both of your suggestions and it is still getting it wrong.
geoffrey
28,736 PointsIf you are sure of what you typed, copy and past the code I put. It should work, I don't know why but this exercise seems a bit bugged. I've seen others people getting a similar issue and by copying the code, that worked... Tell me what after that.
jason chan
31,009 Pointsecho "Mike";
Jaimee Williams
176 PointsThis is what I entered <?php $name = "mike" echo $name; ?>
geoffrey
28,736 PointsEven if what you did previously seemed to be right, test with this code.
<?php
$name = "Mike";
echo $name
?>
It seems It has worked for another person, check this topic.
The only difference is that the last line doesn't end with a semicolon... Fortunately I don't often see such issues with code challenge here at treehouse.
Jaimee Williams
176 PointsI got it right! Thank you!
geoffrey
28,736 PointsGlad that worked ;) !
Jaimee Williams
176 PointsJaimee Williams
176 PointsYea I copied and pasted and its not still not working