Using the <h2> as the title after sent?
<p>Currently, I have a semi-dynamic system for my website's pages. <code>head.php</code> has all the tags before the content body, <code>foot.php</code> the tags after. Any page using the main theme will include head.php, then write the content, then output foot.php. Currently, to be able to set the title, I quickly set a variable <code>$title</code> before inclusion:</p>

<pre>&lt;?php $title = 'Untitled document'; include_once '../head.php'; ?&gt;
&lt;h2&gt;Untitled document&lt;/h2&gt;
Content here...
&lt;?php include_once '../foot.php'; ?&gt;</pre>

<p>So that in head.php...</p>

<pre>&lt;title&gt;&lt;?php echo $title; ?&gt; | Delan Azabani&lt;/title&gt;</pre>

<p>However, this seems kludgy as the title is most of the time, the same as the content of the <code>h2</code> tag. Is there a way I can get PHP to read the content of <code>h2</code>, track back and insert it, then send the whole thing at the end?</p>
