My code looks like this:
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php echo '<p>Hello World</p>'; ?>
</body>
</html>
and outputs this:
Hello World
'; ?>
What are those extra characters doing there?
Thanks!
My code looks like this:
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php echo '<p>Hello World</p>'; ?>
</body>
</html>
and outputs this:
Hello World
'; ?>
What are those extra characters doing there?
Thanks!
You can't end a file in .html
and expect your web server to parse it as PHP.
In that case it's sent directly to the browser without anything being parsed or executed as PHP.
Instead, save it as index.php
for example, then view it in your browser. If you have PHP installed then you should get the output you expect.