操作网络xml接口

Posted on Posted in php
Tips: 本文创建于2014年5月8日,已超过 2 年,内容或图片可能已经失效!

例子
[code lang="php"]
$dom = new DOMDocument('1.0','utf-8');
$dom->load('http://flash.weather.com.cn/wmaps/xml/china.xml');
$cityNodeList = $dom->getElementsByTagName('city');
foreach($cityNodeList as $cityNode){
echo($cityNode->getAttribute('cityname').'----'.$cityNode->getAttribute('stateDetailed'));
echo('<hr>');
}
[/code]

» 转载请注明来源:若我若鱼 » 操作网络xml接口

Leave a Reply

Your email address will not be published. Required fields are marked *

3 × 5 =