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

100% sure I'm filling this in correctly..what gives

.

index.php
<?php

$name = "Mike";

?>

<html>
  <head>

    <title><?php echo $name ?> | Treehouse Profile</title>

  </head>
</html>

It's a good idea to post the question. Not everyone who can help has necessarily seen the question.

Declare variable called name with value of Mike, echo $name to screen.

Just ran through the challenge, i think Holger Liesegang is correct

2 Answers

Hi Eoghan Uttley !

You might just want to add the echo statement under the variable declaration like this and you can pass the challenge:

<?php
$name = "Mike";
echo($name);
?>

Ta mate

You're welcome and welcome to Treehouse, Eoghan Uttley !

I think you forgot a semicolon

<?php echo $name; ?>

EDIT

if you only want to echo 1 variable you can also use the shorthand notation:

<?=$name?>

Still doesn't work no :(