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 trialJames Wrest
3,480 Pointscant echo mike?
Hi I'm not sure what im doing wrong?
<?php
$name = "Mike";
php echo $name
?>
1 Answer
Samuel Webb
25,370 PointsRemove 'php' before 'echo' and add a semicolon after $name.
Samuel Webb
25,370 PointsSamuel Webb
25,370 PointsSince you're already inside of a PHP block, you don't need to write out 'php' before the echo statement. And make sure you end every statement inside of a PHP block with a semicolon. PHP is really strict about that.
Samuel Webb
25,370 PointsSamuel Webb
25,370 PointsActually, the test will still pass without a final semicolon. Your code can be either of the following:
or
I would suggest going with the second version since it's always good practice to end your statements with the semicolon.