 <p>If you want html within php, best way is to separate html and php like,</p> <pre><code>&lt;?php //some php code ?&gt; &lt;!--html content --&gt; </code></pre> <p>If there is small html within php then you can do like,</p> <pre><code>&lt;?php echo '&lt;b&gt;Bold stuff&lt;/b&gt;'; ?&gt; </code></pre> <p>If there is mixing of lot of html and php, then use heredoc, <a href="http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc" rel="nofollow">http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc</a></p>