PHP警告:DOMDocument :: loadHTML():属性alt重新定义

时间:2013-03-11 10:01:21

标签: php warnings domdocument

我在CentOS上运行以下代码

$roster = $utils->getContentCURL("http://exporter.nih.gov/ExPORTER_Catalog.aspx");
$docmp = new DOMDocument();
$docmp->loadHTML($roster);

它给了我一些警告,比如

  

PHP警告:DOMDocument :: loadHTML():属性alt重新定义

任何想法,如何摆脱它?

1 个答案:

答案 0 :(得分:4)

作为validation of the website tells youalt定义了两次错误<div align="center"> <a href="XMLData/final/RePORTER_PRJ_X_FY2013_088.zip" title="Click here to download XML File format" > <img src="images/xml_icon.gif" alt="Click here to download XML format file" <!-- RIGHT THERE! --> width="41" height="13" border="0" alt="" <!-- RIGHT THERE! --> /> </a> <br/> <b>(~1 MB)</b> </div> 。一个例子是在第252行:

{{1}}

如果你拥有这个网站(是吗?)那么你应该删除这些(或者让他们修理他们的网站)。