开发者

Two times html entity decode

Can somebody please explain me why I need to html_entity_decode the $reversecaption two times to get the decoded characters?

Edit: $finalArray['Caption'] is开发者_JAVA技巧 pure text that comes from a XML file.

$reversecaption = html_entity_decode($finalArray['Caption'],ENT_QUOTES, "ISO8859-1");
$reversecaption = html_entity_decode($reversecaption,ENT_QUOTES, "ISO8859-1");

If I run it just once the characters stay encoded.

$reversecaption = html_entity_decode($finalArray['Caption'],ENT_QUOTES, "ISO8859-1");

I'm new to PHP so I'ld like to get that logic.


We have no idea where your original data is coming from, but it was obviously double-encoded!

Double-encoded data looks like &, ", ...

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜