Do I need a !DOCTYPE declaration in a php file with html?

前端 未结 10 1207
面向向阳花
面向向阳花 2020-12-15 03:16

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

10条回答
  •  一生所求
    2020-12-15 03:53

    Yes, you should have the DOCTYPE declaration, since what you send the browser is HTML, not PHP.

    The declaration tells the browser that you are using HTML 5 and tells it how to render it.

提交回复
热议问题