HTML Schema[top]
Though stricter versions of HTML exist, the minimum proper format you should follow is:
<html>
<head>
<title>
</title>
</head>
<body>
</body>
<html>
You may put your code in between the <body> and </body> tags and remain confident that anyone with a web browser will see it.
PHP Schema[top]
What's not to love about PHP...except coding! At least you can be confident that all who have a browser will be able to see code that is strictly php-based (e.g., no javascript or any other script residing in it), because it is dependent on whether or not your server accomodates the code. So if you have the ability to render php, your users will see it!
Minimally, your code should begin and end like this:
<?php
?>
Combining PHP & HTML[top]
Whenever combining HTML & PHP (yes, it can be done), you must save it as .php in order to share it across the world wide web.
<?php
?>
<html>
<head>
<title>
</title>
</head>
<body>
</body>
</html>
or
<html>
<head>
<title>
</title>
</head>
<body>
<?php
?
>
</body>
</html>
It matters not which code starts. It only matters that you (1) get your code working, and (2) allow your code to be seen - save it with and publish it as .php.