Q:

sample PHP problems

<!doctype html>
<html>
<head><title>Hello World Script</title></head>
<body>
<?php
echo “<p>Hello World!</p>\n”;
?>
</body>
</html>

I want to learn PHP and this is my first program. But it has error. This program should just display "Hello World", but it display something else below hello world \n” ?>
Does anyone know what's going on?

A:

You should use double quotes " or single quotes ' to define your string, but not this “” quotes. Also : you are trying to break line in html, so use <br /> instead of \n.
echo "<p>Hello World!</p><br />";

