How to replace code between the specific tags and apply php eval on it
<p>I have a variable which calls content from database, sample is below</p>

<pre><code>$content = '&lt;div&gt;&lt;h1&gt;content here&lt;/h1&gt;
&lt;img src = 'image.jpg' /&gt;&lt;br /&gt;

[code]echo 'welcome';[/code]

&lt;h2&gt;some content here&lt;/h2&gt;
&lt;p&gt; some large content here&lt;/p&gt;

[code]echo 'Click Here';[/code]

Thank you.';

echo 'headers here' .$content . 'footers here';
</code></pre>

<p>how can i execute PHP for the content in between [code] and [/code] tags?
remaining text would written as html execpt the codes used in <strong>[code] some php code [/code] tags</strong></p>
