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 trialAdam White
10,571 PointsThe PHP challenge says this is an incorrect way to echo Mike. Can't figure out why
PHP basics challenge to echo Mike onto the screen. I've checked 10 times now, and I can't see how what I've typed isn't matching the tutorial video.
<?php $name = "Mike" ?> <h1><?php echo $name ?></h1>
<?php $name = "Mike" ?>
<h1><?php echo $name ?></h1>
3 Answers
Kevin Korte
28,149 PointsYou're technically right, try removing the H1 tag and putting both php statements in the same block, separated by colons.
Erik McClintock
45,783 PointsAdam,
The issue here is that you've created an h1 tag and a second PHP block. You didn't do anything incorrect as far as actual code goes, but for the challenge, they want you to keep everything in the same PHP block.
<?php
$name = "Mike";
echo $name;
?>
Erik
Adam White
10,571 PointsThat was it! Thanks, Kevin.