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

Karalyn Heath
Karalyn Heath
18,033 Points

Not passing Challenge Task 2 in PHP Variables

The challenge says to echo Mike's name. Not sure what I'm missing.

index.php
<?php

$name = "Mike";

?>

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

1 Answer

Erik McClintock
Erik McClintock
45,783 Points

Karalyn,

There are two issues here: 1) You're missing your semi-colon after the $name variable in your echo statement, 2) This task wants you to echo that variable in the same PHP code block, it doesn't want you to create a paragraph element and echo it there. Just write your echo statement immediately beneath your variable declaration (don't forget to close the line with a semi-colo!) and you should be good to go!

Erik

Karalyn Heath
Karalyn Heath
18,033 Points

Thanks Erik, I had previously tried doing the echo in the same block but maybe I forgot the semicolon the first time. Passing challenge now!