How do I do this in PHP?
<p>without right-clicking the browser just to view the source, how to display php results as html markup so user can also copy it.</p>

<p>example:</p>

<pre><code>$var = 'ipsum'; //user input stored in variable

&lt;p style="align="center"&gt;Lorem &lt;?php echo $var; ?&gt; dolor sit amet&lt;/p&gt;
</code></pre>

<p>output:</p>

<pre><code>Lorem ipsum dolor sit amet
</code></pre>

<p>at the same time, I want to show the html markup so the user can directly copy it without viewing the source like so:</p>

<pre><code>&lt;p style="align="center"&gt;Lorem ipsum dolor sit amet&lt;/p&gt;
</code></pre>

<p>How do I do this in php? appreciate the help. thanks</p>
