首页 > 其他 > 详细

正则表达式截取xml

时间:2017-09-29 22:17:25      阅读:409      评论:0      收藏:0      [点我收藏+]
$str = ‘<Ips><GateWayRsp><head><ReferenceID>123</ReferenceID><RspCode>000000</RspCode><RspMsg><![CDATA[成功]]></RspMsg><ReqDate>20170928102447</ReqDate><RspDate></RspDate><Signature>eed5b1e42d5a5fb0a6ef569ccec76cef</Signature></head><body><MerBillNo>201709250000010947-iMcL2O9jx</MerBillNo><CurrencyType>156</CurrencyType><Amount>0.02</Amount><ExchangeRate>1</ExchangeRate><RMBAmount>0.02</RMBAmount><Date>20170928</Date><Status>Y</Status><Msg><![CDATA[支付成功!]]></Msg><Attach><![CDATA[Fannie]]></Attach><IpsBillNo>BO20170928102638023091</IpsBillNo><IpsTradeNo>2017092810570071678</IpsTradeNo><RetEncodeType>17</RetEncodeType><BankBillNo>7110862177</BankBillNo><ResultType>0</ResultType><IpsBillTime>20170928105909</IpsBillTime></body></GateWayRsp></Ips>‘;
preg_match(‘/(?<=<\/head>)(.*)(?=<\/GateWayRsp>)/‘, $str, $match);

正则表达式截取xml

原文:http://www.cnblogs.com/fengliang/p/7612845.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!