How to show html as text in php?

Post Reply
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

How to show html as text in php?

Post by Neo » Tue Jun 08, 2010 10:23 am

Recently, I wanted to show some of my html routines to browser but you all know that it is not possible by using echo command as the browser executes html. Here is the method to do it. This method converts < into < and > into > so it would all show up as text.

Code: Select all

<?php 
echo htmlentities("<BR>");
?>
Post Reply

Return to “PHP & MySQL”