日期:2014-05-16 浏览次数:20421 次
header("Content-type:text/html; Charset=utf-8");
$url = "http://www.hnta.cn/APIs/API_Get_NewsList.Asp?m=1&cid=J162HHC8824H&page=1&pagesize=2";
$xml=simplexml_load_file($url); //将XML中的数据,读取到数组对象中
foreach($xml as $tmp){
//echo $tmp->title."-".$tmp->url."<br>";
}
$qf->assign('xml',$xml);
{foreach from=$xml item=list}
{$list.title} |
{/foreach}
SimpleXMLElement Object
(
[@attributes] => Array
(
[page] => 1
[pagesize] => 2
[RecordCount] => 13995
)
[news] => Array
(
[0] => SimpleXMLElement Object
(
[@attributes] => Array
(
[classid] => J162HHC8824H
[classname] => 地市信息
)
[id] => 37169
[title] => 漯河市旅游局部署全市旅游安全工作
[pic] =&