Why won't it decode the html object?

Try it yourself:

echo(html_entity_decode("…")); 

This is echos … instead of as it should be.

Why it will not be decoded and how can I do it?

+6
source share
1 answer

Since the default target character set ISO-8859-1 does not contain the character "...". You need to explicitly specify UTF-8:

 html_entity_decode('…', ENT_QUOTES, 'UTF-8') 

Note that this has changed in PHP 5.3.3, where UTF-8 has become the default.

+12
source

Source: https://habr.com/ru/post/887419/


All Articles