I have a php file with my website content in it. The file needs to be .php because i get some variables first and then use it later in the website content. Like this example
PHP really has nothing to do with HTML - it's just the server-side code spitting out a bunch of text that the browser interprets.
A doctype is a critical part of how the browser interprets the HTML that follows.