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 trialQuinten Van Gorp
4,693 PointsNot outputting Mike according to the challenge...
I can't see what I'm doing wrong and why my output isn't "Mike'.
<?php
$name = "Mike";
?>
<?php echo $name ?>
2 Answers
Grace Kelly
33,990 PointsHi Quinten, it seems you are missing a semi colan at the end of your echo statement, try this:
<?php echo $name; ?>
thomascawthorn
22,986 PointsTry putting everything into one php block:
<?php
$name = "Mike";
echo $name;
?>
Placid Rodrigues
12,630 PointsAlthough both suggestions by Grace Kelly and Tom Cawthorn are focused on better programming styles, I don't think any of the answers will solve the issue. I have tried Quintin's code exactly as he wrote it and I got perfect output. The problem is somewhere else.
thomascawthorn
22,986 PointsI've just tried my code in the challenge and it passed.
What's the response you're getting back?
Placid Rodrigues
12,630 PointsPlacid Rodrigues
12,630 PointsThis is not the problem here. This code can work perfectly here without the semicolon. Although a semicolon should always be there for different reasons. Check here: http://php.net/manual/en/language.basic-syntax.instruction-separation.php
On a second thought, the code challenge might require you to put in the semicolon.