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

Inside of the body tags add a php statement that echos the phrase "Hello World"

that was the question and my answer was as follows <p><?php "Hello, World;" ?></P> however it didn't let me go through to the next section

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

6 Answers

Erik McClintock
Erik McClintock
45,783 Points

Ismail,

These code challenges are very particular about what they accept, and you have to make sure you do things EXACTLY as they specify. In this case, you have two errors:

1) Your semi-colon is inside your quotation marks, making it a part of the string that you're echoing, and thus leaving the statement unclosed. You need to move the semi-colon outside of the quotation marks.

2) You are echoing "Hello, World" with a comma. You need to echo simply "Hello World"

Erik

Hugo Paz
Hugo Paz
15,622 Points

Hi Ismail,

You have the semi colon inside the string, it should look like:

<p><?php echo "Hello, World"; ?></p>

PHP requires instructions to be terminated with a semicolon at the end of each statement.

Thanks guys!

im also facing same challange

Inside of the body tags add a php statement that echos the phrase "Hello World"

Sean Flanagan
Sean Flanagan
33,235 Points
<p><?php echo "Hello World" ?></p>