duquxml,该怎么处理

WBOY
Lepaskan: 2016-06-13 12:19:24
asal
896 orang telah melayarinya

duquxml







有人会用php读去这种xml文件吗?

帮帮忙
------解决思路----------------------

$s =<<< TXT<br /><row dataType="TR" ID="07A72498325C0B0DE050C7707961FCF8" agentCode="253001001001001" transferId="C81_AGIN3439952663804" tradeNo="141112789497906" platformType="AGIN" playerName="C81AGIN79514" transferType="IN" transferAmount="100" previousAmount="0" currentAmount="100" currency="CNY" exchangeRate="1" IP="0" flag="0" creationTime="2014-11-12 06:08:12" gameCode="" /><br /><row dataType="TR" ID="07A75AD0A35E1114E050C7707961FF13" agentCode="253001001001001" transferId="C81_AGIN3439952663804" tradeNo="141112789497906" platformType="AGIN" playerName="C81AGIN79514" transferType="IN" transferAmount="100" previousAmount="0" currentAmount="100" currency="CNY" exchangeRate="1" IP="0" flag="0" creationTime="2014-11-12 06:08:12" gameCode="" /><br /><row dataType="TR" ID="07A72498325D0B0DE050C7707961FCF8" agentCode="253001001001001" transferId="C81_AGIN3439952663804" tradeNo="141112789497906" platformType="AGIN" playerName="C81AGIN79514" transferType="IN" transferAmount="100" previousAmount="0" currentAmount="100" currency="CNY" exchangeRate="1" IP="0" flag="0" creationTime="2014-11-12 06:08:12" gameCode="" /><br /><row dataType="TR" ID="07A75AD0A3921114E050C7707961FF13" agentCode="253001001001001" transferId="C81_AGIN3439952663804" tradeNo="141112789497906" platformType="AGIN" playerName="C81AGIN79514" transferType="IN" transferAmount="100" previousAmount="0" currentAmount="100" currency="CNY" exchangeRate="1" IP="0" flag="0" creationTime="2014-11-12 06:08:12" gameCode="" /><br />TXT;<br /><br />$x = simplexml_load_string("<root>$s</root>");<br />print_r($x);
Salin selepas log masuk
SimpleXMLElement Object<br />(<br />    [row] => Array<br />        (<br />            [0] => SimpleXMLElement Object<br />                (<br />                    [@attributes] => Array<br />                        (<br />                            [dataType] => TR<br />                            [ID] => 07A72498325C0B0DE050C7707961FCF8<br />                            [agentCode] => 253001001001001<br />                            [transferId] => C81_AGIN3439952663804<br />                            [tradeNo] => 141112789497906<br />                            [platformType] => AGIN<br />                            [playerName] => C81AGIN79514<br />                            [transferType] => IN<br />                            [transferAmount] => 100<br />                            [previousAmount] => 0<br />                            [currentAmount] => 100<br />                            [currency] => CNY<br />                            [exchangeRate] => 1<br />                            [IP] => 0<br />                            [flag] => 0<br />                            [creationTime] => 2014-11-12 06:08:12<br />                            [gameCode] => <br />                        )<br /><br />                )<br /><br />            [1] => SimpleXMLElement Object<br />                (<br />                    [@attributes] => Array<br />                        (<br />                            [dataType] => TR<br />                            [ID] => 07A75AD0A35E1114E050C7707961FF13<br />                            [agentCode] => 253001001001001<br />                            [transferId] => C81_AGIN3439952663804<br />                            [tradeNo] => 141112789497906<br />                            [platformType] => AGIN<br />                            [playerName] => C81AGIN79514<br />                            [transferType] => IN<br />                            [transferAmount] => 100<br />                            [previousAmount] => 0<br />                            [currentAmount] => 100<br />                            [currency] => CNY<br />                            [exchangeRate] => 1<br />                            [IP] => 0<br />                            [flag] => 0<br />                            [creationTime] => 2014-11-12 06:08:12<br />                            [gameCode] => <br />                        )<br /><br />                )<br /><br />            [2] => SimpleXMLElement Object<br />                (<br />                    [@attributes] => Array<br />                        (<br />                            [dataType] => TR<br />                            [ID] => 07A72498325D0B0DE050C7707961FCF8<br />                            [agentCode] => 253001001001001<br />                            [transferId] => C81_AGIN3439952663804<br />                            [tradeNo] => 141112789497906<br />                            [platformType] => AGIN<br />                            [playerName] => C81AGIN79514<br />                            [transferType] => IN<br />                            [transferAmount] => 100<br />                            [previousAmount] => 0<br />                            [currentAmount] => 100<br />                            [currency] => CNY<br />                            [exchangeRate] => 1<br />                            [IP] => 0<br />                            [flag] => 0<br />                            [creationTime] => 2014-11-12 06:08:12<br />                            [gameCode] => <br />                        )<br /><br />                )<br /><br />            [3] => SimpleXMLElement Object<br />                (<br />                    [@attributes] => Array<br />                        (<br />                            [dataType] => TR<br />                            [ID] => 07A75AD0A3921114E050C7707961FF13<br />                            [agentCode] => 253001001001001<br />                            [transferId] => C81_AGIN3439952663804<br />                            [tradeNo] => 141112789497906<br />                            [platformType] => AGIN<br />                            [playerName] => C81AGIN79514<br />                            [transferType] => IN<br />                            [transferAmount] => 100<br />                            [previousAmount] => 0<br />                            [currentAmount] => 100<br />                            [currency] => CNY<br />                            [exchangeRate] => 1<br />                            [IP] => 0<br />                            [flag] => 0<br />                            [creationTime] => 2014-11-12 06:08:12<br />                            [gameCode] => <br />                        )<br /><br />                )<br /><br />        )<br /><br />)<br /><br />
Salin selepas log masuk

Label berkaitan:
sumber:php.cn
Kenyataan Laman Web ini
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn
Tutorial Popular
Lagi>
Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan
Tentang kita Penafian Sitemap
Laman web PHP Cina:Latihan PHP dalam talian kebajikan awam,Bantu pelajar PHP berkembang dengan cepat!