【发布时间】:2012-07-03 08:22:13
【问题描述】:
下面的这段代码给了我一个 DOMDocument 警告,我想知道为什么。我可以做些什么来修复它,或者不显示这个特定的警告?我在 windows xp 和 iis 上运行 php。
$content = "<html><body><p>'HTTP_REFERER' => 'http://localhost/?table=event_occurrence_person&LB1ID='</p></body></html>";
$dom = new DOMDocument;
$dom->loadHTML($content);
警告:DOMDocument::loadHTML(): htmlParseEntityRef: 期待 ';'在实体中,行:1 in...
【问题讨论】:
-
尝试将 $content 放在单引号中。 HTTP_REFERER 可能被视为常量。
-
@Way 不,那不可能。
标签: php windows iis domdocument