Page 1 of 1
Convert HTML code in PHP
Posted: Mon Apr 09, 2012 11:41 pm
by janakghij
Hi all,
How we can convert the HTML code in the PHP code what special code is used for converting the HTML code in PHP?
Re: Convert HTML code in PHP
Posted: Tue Apr 10, 2012 12:11 am
by social_experiment
Could you clarify what is meant by "convert"? To make html characters like < and > (among others) 'safe' for display purposes, you can use htmlentities() or htmlspecialchars(). If you are refering to simply displaying html via php, there is no special code; you just echo it
Code: Select all
<?php echo '<h1>A header</h1>'; ?>