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?
Yes you should, not because you’re using PHP, but because you should be using HTML5 these days.
The doctype does not have anything to do with PHP at all, as it is a serverside language. The doctype will however affect the HTML you output.
Some browsers (read: IE) could have issues if ANY characters are outputted before the doctype, and using PHP before the doctype is’nt normally a problem, just make sure there are no empty space or linebreaks outputted in the HTML before the doctype.