开发者

Two times html entity decode

开发者 https://www.devze.com 2023-03-15 14:32 出处:网络
Can somebody please explain me why I need to html_entity_decode the $reversecaptiontwo times to get the decoded characters?

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

精彩评论

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