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 trial

PHP PHP Basics (Retired) PHP Data & Structure PHP Variables

Help

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?

index.php
<?php

$name = "Mike";

?>

<h1><?php echo $name; ?></h1>

2 Answers

Hi 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

Thank you for the help!! -Kellan

No problem :)

This 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.