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
When they contain embedded HTML, it's better to think of .php files as regular HTML files which the server has been instructed to scan for dynamic (PHP) code.
A valid !DOCTYPE declaration is still necessary for the document to be semantic.