Question: I always include the following DTD on my web pages:

```
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

```

I want to start using PHP on one of my sites. Should I modify this DTD in any way in order for it to remain valid?

And is there any reason why I should **not** use PHP blocks before the DTD or should the DTD always be the very start of each file?

Answer: 
Php is a server side language which generates text for the browser. The browser interprets HTML text exactly the same regardless of how the HTML was generated. Hard-coded html is interpreted in the browser the same as ASP-generated HTML, which is interpreted the same as PHP-generated HTML.

So your `Doctype` does **not** need to be customized based on any choice of server-side scripting language.
The choice of server-side technology used to generate pages does not affect the choice of doctype as such. What matters is the markup that gets sent to browsers.

The doctype statement (not a DTD – it’s in principle a reference to a DTD, though browsers don’t treat it that way) should be at the very start of an HTML document, but this applies to the HTML document sent to browsers. A .php file is not really an HTML document (or need not be), and any PHP instructions at the start are to be processed by server-side code and never reach a browser.