When htmlemtities() Is Failing

../_images/htmlemtities_failing.png

By default, htmlemtities() uses UTF-8. The third argument of that function is the actual encoding, so it is a parameter. When using a non-existing encoding, such as xxx, PHP detects it, and default to UTF-8 (here it works well).

On the other hand, when using a valid encoding, but that is not supported, PHP default to returning an empty string.

See Also

PHP Error Messages

PHP Features