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 trialShahzain Hashmi
2,360 PointsVariable Is not echoing
I have named the variable, however when trying to echo Mike's name, it doesn't work. Could you tell me where I'm going wrong?
<?php
$name = "Mike";
?>
<?php echo $name ?>
1 Answer
Greg Kaleka
39,021 PointsHi Shahzain,
I've seen this get people before! The challenge wants you to only use a single PHP block. In real life, there's no reason to only use one, but that's what the challenge is looking for. Your code is otherwise perfect (though it's best practice to always use semicolons!), so all you have to do is mash it together:
<?php
$name = "Mike";
echo $name;
?>
Shahzain Hashmi
2,360 PointsShahzain Hashmi
2,360 PointsCheers Greg!