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

Joshua Howard
Joshua Howard
12,676 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,075 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,676 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,075 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.