Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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,809 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,809 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,008 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.