开发者

Why won't this decode to the html entity?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜