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) What is PHP? PHP Basic Usage

Hello <?php echo "World";?>! is giving me a message that says that I am wrong for writing a message that echoes "hello W

The message is prompted on they screen reading, " Make sure that you are echoing the right phrase". What shall I do from thus point?

index.php
<html>
<head>
<title>PHP Basic Usage Challenge</title>
</head>
<body> 
  <p>
     <?php echo "Hello World";?>!
  </p>

</body>
</html>

3 Answers

<?php 
         echo "Hello World"
?>

No p tag or ;

Roy Penrod
Roy Penrod
19,810 Points

The code challenges are very specific. The exclamation point at the end is causing it to fail the check. Just remove the exclamation point and it passes.

It's also good form to put a space between the semi-colon and the closing question mark tag. The computer doesn't care, but it makes it a bit easier to read for us peoples. :-)

edited: spelling

Roy Penrod
Roy Penrod
19,810 Points

Some of the other answers are focusing on the paragraph tags. I tested it with the paragraph tags left in and it passes. It's the exclamation point that's stopping it from passing.

jason chan
jason chan
31,009 Points
<html>
<head>
<title>PHP Basic Usage Challenge</title>
</head>
<body>
<?php echo "Hello World"; ?>
</body>
</html>

That's the answer. Do not use the html paragraph tag those are not needed it's asking you to print hello world. In php echo is print.