开发者

Why won't this decode to the html entity?

开发者 https://www.devze.com 2023-03-03 20:35 出处:网络
Try it yourself: echo(html_entity_decode(\"…\")); It echos … instead of … as it should.

Try it yourself:

echo(html_entity_decode("…"));

It echos … instead of as it should.

Why won't this decode开发者_运维知识库 and how can I make it do so?


Because the default ISO-8859-1 target character set does not contain the "…" character. You'll have to explicitly target UTF-8:

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

Note that this changed in PHP 5.3.3 where UTF-8 became the default.

0

精彩评论

暂无评论...
验证码 换一张
取 消