Starting some PHP and confused by the way echo/print are working.
I’ve got this code in my index.html:
<?php
Print '<div>Hello, World!</div>';
?>
And the output on my page is
Hello, World!'; ?>
If I remove the <div> tags, I get no output. using echo produces the same behaviour.
What’s going on? Everything I find on Google makes it seem straight forward.
You cannot put PHP code in an HTML file (unless you tell Apache to parse HTML files).
Rename the file to index.php
Do you have a webserver with PHP set-up?