This function is identical to htmlspecialchars() in all ways, except with htmlentities(), all characters which have HTML character entity equivalents are translated into these entities.

declaration of htmlentities

string htmlentities ( string $str [, int $quote_style ] [, string $charset ] )

test htmlentities online

share htmlentities

comments for htmlentities

On 12. Feb 2010 16:18 basnik wrote:

This page is great, but there's one big problem for me. Page encoding is set to ISO-8859-15, so if I want to try something with different charset (mainly UTF-8), I get question marks instead of my input.

On 01. Dec 2009 14:30 butzi wrote:

@rolf: it is not as easy as it looks like. The content should not be changed through this replacement, stripslashes will also remove slashes, that are provided through the input eg. escaped double quotations ... thats why it takes some time :-)

On 01. Dec 2009 11:29 rolf wrote:

Just a call to stripslashes on the output, and it should be OK ;)

more comments for htmlentities

There are some more comments for htmlentities(). To see them all click here.


Leave your comment