Using any form of templating, even if it’s just including a header.php and footer.php in each page, is supposed to make a developer’s life easier. Imagine the confusion the below code causes when, as you’re reviewing some new code, you run across a seemingly random
</head> tag. Where is the rest of the markup, you might ask? Why, take a look at
1 2 3 4 5 6 7 8 9 10
I’m not a big fan of functions that simply
echo HTML, but if you’re going to do something like this, at least include the closing head tag. Seriously. Or I might come find you and punch you square in the jeans.
Another, better option is to find a PHP templating engine that’ll do most of your templating for you.