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

Jose Pena
Jose Pena
1,135 Points

Now echo Mike's Name To The Screen. (Request) <?php $name = "Mike"; ?> <p><?php echo $name; ?></p>

See the above request and my answer below, I tested it on my server and it worked, for some reason I am getting an error message when I check the work.

index.php
<?php 

$name = "Mike";

?>

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

2 Answers

Jeff Lemay
Jeff Lemay
14,268 Points

While what you have is technically correct, the challenges look for very specific code. You did not need to wrap the echo statement in < p > tags and this challenge REQUIRES that all your code be in a single php block:

<?php 
$name = "Mike";
echo $name;
?>
Jose Pena
Jose Pena
1,135 Points

I think that was my first try, let me try it again, maybe when I did it I got something else wrong. Let me see.