$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),我认为这意味着没有在那里定义⅝实体.