如何解析远程xml文件?

$url = "http://xxxx.163.com/xml.file";


xmlObj = simplexml_load_file($url);

$arrXmlObj = get_object_vars($xmlObj);

if(is_array($arrXmlObj['order'])){

$orders = $arrXmlObj['order'];

foreach($orders as $order){

//some opt

}

}



如果直接simplexml_load_file之后获得的数组无法解析,原因未知,必须使用get_object_vars将获得的xml对象变为数组才可以进行相关操作

相关文章

php输出xml格式字符串
J2ME Mobile 3D入门教程系列文章之一
XML轻松学习手册
XML入门的常见问题(一)
XML入门的常见问题(三)
XML轻松学习手册(2)XML概念