我试图使用simplexml解析以下
XML …
但是一旦我添加了这条线……
$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‘);