Re: htmlentities() with utf8

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

 



On Thu, May 4, 2006 11:02 am, Marten Lehmann wrote:
> I want to use htmlentities() with UTF-8, which I can set with the
> third
> parameter. But to use the third parameter, I have to provide the
> second
> parameter. Currently the default for the second parameter is
> ENT_COMPAT.
> But as this might change, I don't want to call htmlentities with
>
> htmlentities($text, ENT_COMPAT, "UTF-8");
>
> all the time. Is there another way?

If you're just trying to type less:

You could try using NULL and see if that kicks in the default...  But
that would be an "undocmented feature" which carries its own risks.



If you are concerned about backwards/forwards compatibility changes:

How about in some 'globals.inc' file you could do:
define('DEFAULT_QUOTE_STYLE', ENT_COMPAT);

Then you can use DEFAULT_QUOTE_STYLE everywhere, and if it changes, or
you want to change it, you only need to change it in one place.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
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