How to get PHP to manipulate HTML code (copy/paste) before displaying the page
<p>How to get PHP to manipulate HTML code (copy/paste) before sending to the browser.</p>

<p>I want to use PHP to get <code>html</code> code form inside <code>h1</code> and paste it in <code>h2</code>. On server. Before page is send over to the browser.</p>

<p>e.g ; </p>

<pre><code>&lt;h1&gt; Some HTML CODE &lt;/h1&gt;
&lt;h2&gt; &lt;!-- EMPTY --&gt; &lt;/h2&gt;

&lt;?php 
   // $var1 = HTML CODE from inside of h1
   // Paste in $var1 inside h2
   // Display The Page
?&gt;
</code></pre>
