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

William Laberge
William Laberge
1,394 Points

why it doesnt work?

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

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

</body>
</html>

2 Answers

The challenge only wants you to echo the string Hello World not to have it in a p tag so you need to write this:

<?php echo "Hello World" ?>
William Laberge
William Laberge
1,394 Points

Thanks! I also notice the exercice didnt ask for the "!" And forgot my ";"

No problem, it will still work with out the semicolon but regardless its good practice to end every statement with a semicolon.

Colin Marshall
Colin Marshall
32,861 Points

Make sure you always type in exactly what the challenge asks for including capitalization and punctuation.

Yes, do exactly what the challenges ask for and nothing else. I agree with the semicolon being added. I always add one because it is too easy to fall into the habit of leaving one off where it is truly needed if I don't.