How to display HTML tags as plain text in browser using php


Show HTML tags in browser we can use  htmlspecialchars()

 <?php  
 $new = htmlspecialchars("<a href='test'>Test</a>", ENT_QUOTES);  
 echo $new; // &lt;a href=&#039;test&#039;&gt;Test&lt;/a&gt;  
 ?>  

Nikunj K

Phasellus facilisis convallis metus, ut imperdiet augue auctor nec. Duis at velit id augue lobortis porta. Sed varius, enim accumsan aliquam tincidunt, tortor urna vulputate quam, eget finibus urna est in augue.