NYCPHP Meetup

NYPHP.org

[nycphp-talk] PHP function to execute HTML tags

Ron Guerin ron at vnetworx.net
Tue Apr 3 18:55:54 EDT 2012


On 04/03/2012 05:44 PM, tuon1 at netzero.net wrote:
> Hi!
> 
> Can you guys tell me what the PHP function that executes HTML tags when
> the content from the database contains HTML tags get dumped onto the
> webpage?
> 
> I used to know it but since I haven't used it for a long time, I can't
> think of its name right now.
> 
> What I am talking about is that when HTML tags got stored in the
> database, it gets treated like ordinary plain texts and when those plain
> texts get dumped onto the webpage, the browser treats or displays them
> as texts.

I'm not entirely sure I understand the question.

You can echo HTML retrieved from the database to execute HTML markup.

To see the markup as text, you can echo it after running it through
htmlentities().

http://us3.php.net/manual/en/function.htmlentities.php

- Ron




More information about the talk mailing list