 <p>This would replace should work.</p> <pre><code>&lt;?php $content = '&lt;iframe src="url.com&amp;em=&lt;!--email--&gt;&amp;se=51" style="width:900px;height:700px;"&gt;&lt;/iframe&gt;'; $content = str_replace('&lt;!-- email --&gt;', $email, $content); </code></pre> <p>If it is possible I would suggest using <a href="http://php.net/sprintf" rel="nofollow">sprintf()</a>.</p> <pre><code>&lt;?php $content = '&lt;iframe src="url.com&amp;em=%s&amp;se=51" style="width:900px;height:700px;"&gt;&lt;/iframe&gt;'; $content = sprintf($content, $email); </code></pre>