Creating a PHP template page
<p>I want to create a reusable PHP template that allows me to insert custom blocks of HTML code in multiple locations for different pages.</p>

<p>For example:</p>

<pre><code>&lt;html&gt;
&lt;body&gt;
&lt;div id="banner"&gt;
### INSERT BLOCK OF CUSTOM HTML HERE ###
&lt;/div&gt;
&lt;div id="main-content"&gt;
### INSERT A DIFFERENT BLOCK OF CUSTOM HTML HERE ###
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>I'd want to have multiple pages using this template, with each page having its own custom HTML code for the "banner" and "main-content" divs.</p>

<p>What's the best way to do this? I've considered using a template engine like Smarty, but I'm concerned about the performance hit. My site is also really simple, so I don't know if a separate template engine is a good idea.</p>

<p>I'm aware I can just use multiple includes, like so:</p>

<pre><code>&lt; ?php include 'top.php' ?&gt;
### CUSTOM HTML ###
&lt; ?php include 'middle.php' ?&gt;
### CUSTOM HTML ###
&lt; ?php include 'bottom.php' ?&gt;
</code></pre>

<p>But I'm wondering if there's a better way to do this? Especially if I have more than two different chunks of custom HTML code, as well as some custom variables (such as a page title string) for each page.</p>