php – 简单的XML命名空间警告
发布时间:2020-12-13 17:47:40 所属栏目:PHP教程 来源:网络整理
导读:我试图使用simplexml解析以下 XML … http://datapoint.metoffice.gov.uk/public/data/txt/wxfcs/regionalforecast/xml/500?key=ed47ad61-5033-48c8-bf7c-6c4c0b17c3f3 但是一旦我添加了这条线…… $xml = simplexml_load_file('http://datapoint.metoffice.
我试图使用simplexml解析以下
XML …
http://datapoint.metoffice.gov.uk/public/data/txt/wxfcs/regionalforecast/xml/500?key=ed47ad61-5033-48c8-bf7c-6c4c0b17c3f3 但是一旦我添加了这条线…… $xml = simplexml_load_file('http://datapoint.metoffice.gov.uk/public/data/txt/wxfcs/regionalforecast/xml/500?key=ed47ad61-5033-48c8-bf7c-6c4c0b17c3f3'); 我得到了错误 namespace warning : xmlns: URI www.metoffice.gov.uk/xml/metoRegionalFcst is not absolute 我似乎无法解决如何解决这个问题. 解决方法
只需在simplexml_load_file之前添加@
喜欢 $xml = @simplexml_load_file(‘http://datapoint.metoffice.gov.uk/public/data/txt/wxfcs/regionalforecast/xml/500?key=ed47ad61-5033-48c8-bf7c-6c4c0b17c3f3‘); (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |