我有这个代码
require('magpierss/rss_fetch.inc');
$url = 'http://weather.yahooapis.com/forecastrss?p=AUXX0013'
$rss = fetch_rss($url);
$title = $rss->items[0]['title'];
$description = $rss->items[0]['description'];如何从xml的这一部分获取数据,例如(code="33“)
<yweather:forecast day="Thu" date="25 Sep 2014" low="43" high="57" text="Mostly Clear" code="33"/>发布于 2014-09-26 03:39:46
如果要提取的数据不是普通RSS文档的一部分,则不能使用创建的库来解析RSS。
只需使用read the XML data,然后使用xpath来获取所需的数据。
https://stackoverflow.com/questions/26046436
复制相似问题