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

Joshua Howard
Joshua Howard
12,413 Points

I don't see what i'm doing wrong here...

I'm pretty sure that this is the command. But it's not working for some reason...

index.php
<html>
<head>
<title>PHP Basic Usage Challenge</title>
</head>
<body>
<?php echo "HELLO WORLD"; ?>
</body>
</html>

3 Answers

Dane Parchment
MOD
Dane Parchment
Treehouse Moderator 11,020 Points

You capitalized the entirety of the word "Hello World".

The challenge asked for "Hello World" not "HELLO WORLD", so its just a matter of grammar, just capitalize the H, and W of Hello World, not the entire word.

Codin - Codesmite
Codin - Codesmite
8,600 Points
<html>
<head>
<title>PHP Basic Usage Challenge</title>
</head>
<body>
<?php echo "Hello World"; ?>
</body>
</html>

This passes the challenge for me, it doesn't require paragraph tags to pass. You will find capitalisation is important in most tasks throughout team treehouse.

Joshua Howard
Joshua Howard
12,413 Points

I tried that and it didn't work. Turns out that it needs to be encloses in paragraph tags. So it's

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

The instructions just didn't specify that

Dane Parchment
Dane Parchment
Treehouse Moderator 11,020 Points

You didn't have to encase them in any of the tags, I just entered:

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

and go it correct, remeber that php compiles to html already, so unless you are specifying tags other than paragraph tags, you don't really need to encase the tags. So the instructions were correct as you don't have to encase the echoed text in any tags, but doing so will garner the same results as not enclosing them so you got it right anyhow.