4
继承人我的代码:html_entity_decode不解码ASCII
$string = 'It';
$string = html_entity_decode($string);
echo $string;
应该呼应“它”,但它只是呼应ASCII码。我使用了错误的功能吗?我也试过htmlspecialchars_decode,它什么都不改变。
继承人我的代码:html_entity_decode不解码ASCII
$string = 'It';
$string = html_entity_decode($string);
echo $string;
应该呼应“它”,但它只是呼应ASCII码。我使用了错误的功能吗?我也试过htmlspecialchars_decode,它什么都不改变。
这些都不是有效的实体其实,他们是在HTML 4有效的(我想HTML5太),但在这种情况下,实体需要被分号终止PHP来识别它们:
$string = 'It';
htmlspecialchars_decode()
只解码<
,>
,&
,'
和"
(和最后两个依赖于引号标志)。
我试过html_entity_decode($ string,ENT_QUOTES,'ISO-8859-1')和 html_entity_decode($ string,ENT_QUOTES),他们都没有工作。该字符串在我的页面上使用ISO-8859-1。我使用$ string = html_entity_decode($ string,ENT_QUOTES,'ISO-8859-1') – scarhand 2011-02-05 20:32:19