Re: Htmlentities vs htmlspecialchars

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dave Goodchild wrote:
> Hi all. I know htmlspecialchars converts the smallest set of entities
> possible to generate valid HTML, and that htmlentities goes much
> further, so
> what is the difference? Is it not better to use htmlentities in every case,
> making htmlspecialchars somewhat redundant, or is there a performance
> tradeoff?

1 kind of performance: 'htmlentities' is less chars to type.

another kind of performance: 'htmlspecialchars' converts a *smaller* set of entities;
this assumes that the size of the set has a measurable impact on the time takento do a
conversion - I doubt that given the actual sizes of the respective entity conversion tables
that this is the case. okay so that's guess work ;-)

personally I always use htmlentities() and be done with it, I had the same 'redundant'
feeling some time back.

I wonder if anyone can given a solid answer to this?

> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux