通过simplexml_load_string处理后数据
接口返回数据:
处理这种xml 数据 想得到里面的节点的值, 请问一下大神们 应该怎么处理
<?xml version='1.0' standalone='yes' charset='gb2312'?><CommPara><ItemPara><ParaRow><retCode>0</retCode><retstr>成功</retstr><VipName>临时会员</VipName><CertNo></CertNo><Mobile></Mobile><retBalance>198770.0000</retBalance><retJF>3916.5000</retJF><retTxt></retTxt></ParaRow></ItemPara></CommPara>
PHP本身就提供了一些库来操作XML,手册:
http://www.php.net/manual/zh/...
DOMDocument
ML Expat Parser
SimpleXML
XMLReader
...
参考一下文章例子
http://blog.csdn.net/aloneswo...
自己看看用什么方法来解析~
哪里解决不了?
比如这样吧,遍历层层解析:
输出:
更简单粗暴的XML转数组,这样子:
输出,直接就是个数组: