How to display HTML code as a simple string/text?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
phazorRise
Forum Contributor
Posts: 134
Joined: Mon Dec 27, 2010 7:58 am

How to display HTML code as a simple string/text?

Post by phazorRise »

HI,
I want to display HTML code as simple string.
I'm accepting string through form post and when I try to print it, it is printed as HTML entities.
So I want to escape the meaning of code and want to print as it is.

Any suggestion for me?
sockpuppet
Forum Newbie
Posts: 22
Joined: Tue Jan 18, 2011 8:38 am

Re: How to display HTML code as a simple string/text?

Post by sockpuppet »

Convert the <> to <> and " to "
User avatar
phazorRise
Forum Contributor
Posts: 134
Joined: Mon Dec 27, 2010 7:58 am

Re: How to display HTML code as a simple string/text?

Post by phazorRise »

sockpuppet wrote:Convert the <> to <> and " to "
simple solution .... i quit too early....
anyway, thankx
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: How to display HTML code as a simple string/text?

Post by AbraCadaver »

htmlentities() and/or html_entity_decode()
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Post Reply