php – 为什么html_entity_decode()适用于第一个字符串,但不适用
发布时间:2020-12-13 21:33:31 所属栏目:PHP教程 来源:网络整理
导读:$string1 = 'Cotton Lanyard frac12;"';$string2 = 'Organic Cotton Lanyard frac58;"';echo html_entity_decode($string1); //Cotton Lanyard ?"echo html_entity_decode($string2); //Organic Cotton Lanyard frac58;" 不确定如何解决这个问题? 解决方法
$string1 = 'Cotton Lanyard ½"'; $string2 = 'Organic Cotton Lanyard ⅝"'; echo html_entity_decode($string1); //Cotton Lanyard ?" echo html_entity_decode($string2); //Organic Cotton Lanyard ⅝" 不确定如何解决这个问题? 解决方法
它适用于HTML5文档类型
flag.
echo html_entity_decode($string2,ENT_HTML5); // Organic Cotton Lanyard ?" 由于默认类型是ENT_HTML401(HTML 4.01),我认为这意味着没有在那里定义?实体. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |