Forum Moderators: mack
If the latter then it depends on how your includes are structured. I usually have my header go from first char of the doc to my content cell <td>
Then my footer from </td> to </html>. If you don't do it that way you may have doctype and title tag on each page and then have from there on in the header. It doesn't make a difference either way. It only depends on how you are doing things.
Would you include the DOCTYPE and namespace declarations in a `header` php include?
Frankly, no I wouldn't, not becuase it wouldn't work, but because I like to use a template that defines the structure of the entire page, then use variables and includes to slide headers, footers, navigation, content into that at the very end (i.e. after all processing, so the template is nothing but HTML, includes and echos). That makes the structure very easy to see, makes the page (and thus most pages on the site) easy to completely revamp in terms of the look by changing one file and nicely separates presentation from logic as much as possible.
Does it matter if you do, or don't?
Remember, DOCTYPE is HTML, and your browser doesn't care how that HTML is generated. I could have the following files
file1.php
<? echo "<DOC";?>
file2.php
<? echo "TYPE";?>
... (2004 files deleted for bevity)
file2007.php
<? echo "</html>";?>
file_main.php
<?
include("file1.php");
include("file2.php");
....
include("file2007.php");
?>