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?
Convert HTML code in PHP
Moderator: General Moderators
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: Convert HTML code in PHP
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>'; ?>“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering