重新定义了属性alt

重新定义了属性alt

本文介绍了PHP警告:DOMDocument :: loadHTML():重新定义了属性alt的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在CentOS上运行以下代码

I am running following code on CentOS

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

它给了我一些警告,例如

it is giving me some warnings like

任何想法,如何获得

推荐答案

作为,有两次定义 alt 的错误。第252行是一个示例:

As the validation of the website tells you, there's several errors of alt defined twice. One example is on line 252:

<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>

如果您拥有此网站(对吗?),那么您应该简单地删除它们(或问问他们)修复他们的网站)。

If you own this website (do you?) then you should simply remove these (or maybe ask them to fix their website).

这篇关于PHP警告:DOMDocument :: loadHTML():重新定义了属性alt的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 17:12