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 trialKellan Doom
1,622 PointsHelp
I am asked to echo the name "Mike" and I have tested this code on my localhost and it works just fine, why will it not pass?
<?php
$name = "Mike";
?>
<h1><?php echo $name; ?></h1>
2 Answers
Rich Bagley
25,869 PointsHi Kellan,
Your code is fine but the challenges can get quite specific with what they ask for.
You don't need the h1
tags for the challenge so your code should look something like this:
<?php
$name = 'Mike';
echo $name;
?>
Hope that helps.
-Rich
thomascawthorn
22,986 PointsThis code should work:
<?php
$name = "Mike";
echo $name;
?>
The code challenges can be quite picky, so if it doesn't ask for html markup (the h1 tags) I would leave them out.
But yes - what you have is correct.
Kellan Doom
1,622 PointsKellan Doom
1,622 PointsThank you for the help!! -Kellan
Rich Bagley
25,869 PointsRich Bagley
25,869 PointsNo problem :)