Heim  >  Artikel  >  Backend-Entwicklung  >  php获取ftp xml解决办法

php获取ftp xml解决办法

WBOY
WBOYOriginal
2016-06-13 12:19:231168Durchsuche

php获取ftp xml
php怎样获取ftp://175.41.22.158/a.xml里面的内容


用户名:test888
密码:test888999
------解决思路----------------------

$url = 'ftp://test888:[email&#160;protected]/a.xml';<br />$s = file_get_contents($url);<br />$xml = simplexml_load_string("<root>$s</root>");<br />print_r($xml);
SimpleXMLElement Object<br />(<br />    [row] => Array<br />        (<br />            [0] => SimpleXMLElement Object<br />                (<br />                    [@attributes] => Array<br />                        (<br />                            [dataType] => BR<br />                            [billNo] => 14111905203313<br />                            [playerName] => u8889995<br />                            [agentCode] => 253001001001001<br />                            [gameCode] => GA00314B1909V<br />                            [netAmount] => 19<br />                            [betTime] => 2014-11-19 05:40:12<br />                            [gameType] => BAC<br />                            [betAmount] => 20<br />                            [validBetAmount] => 19<br />                            [flag] => 1<br />                            [playType] => 1<br />                            [currency] => CNY<br />                            [tableCode] => C3<br />                            [loginIP] => 183.94.238.85<br />                            [recalcuTime] => 2014-11-19 05:40:40<br />                            [platformType] => AGIN<br />                            [remark] => <br />                            [round] => AGQ<br />                            [result] => <br />                        )<br /><br />                )<br /><br />            [1] => SimpleXMLElement Object<br />                (<br />                    [@attributes] => Array<br />                        (<br />                            [dataType] => BR<br />                            [billNo] => 14111905203313<br />                            [playerName] => u8889995<br />                            [agentCode] => 253001001001001<br />                            [gameCode] => GA00314B1909V<br />                            [netAmount] => 19<br />                            [betTime] => 2014-11-19 05:40:12<br />                            [gameType] => BAC<br />                            [betAmount] => 20<br />                            [validBetAmount] => 19<br />                            [flag] => 1<br />                            [playType] => 1<br />                            [currency] => CNY<br />                            [tableCode] => C3<br />                            [loginIP] => 183.94.238.85<br />                            [recalcuTime] => 2014-11-19 05:40:40<br />                            [platformType] => AGIN<br />                            [remark] => <br />                            [round] => AGQ<br />                            [result] => <br />                        )<br /><br />                )<br /><br />            [2] => SimpleXMLElement Object<br />                (<br />                    [@attributes] => Array<br />                        (<br />                            [dataType] => BR<br />                            [billNo] => 14111905203313<br />                            [playerName] => u8889995<br />                            [agentCode] => 253001001001001<br />                            [gameCode] => GA00314B1909V<br />                            [netAmount] => 19<br />                            [betTime] => 2014-11-19 05:40:12<br />                            [gameType] => BAC<br />                            [betAmount] => 20<br />                            [validBetAmount] => 19<br />                            [flag] => 1<br />                            [playType] => 1<br />                            [currency] => CNY<br />                            [tableCode] => C3<br />                            [loginIP] => 183.94.238.85<br />                            [recalcuTime] => 2014-11-19 05:40:40<br />                            [platformType] => AGIN<br />                            [remark] => <br />                            [round] => AGQ<br />                            [result] => <br />                        )<br /><br />                )<br /><br />            [3] => SimpleXMLElement Object<br />                (<br />                    [@attributes] => Array<br />                        (<br />                            [dataType] => BR<br />                            [billNo] => 14111905203313<br />                            [playerName] => u8889995<br />                            [agentCode] => 253001001001001<br />                            [gameCode] => GA00314B1909V<br />                            [netAmount] => 19<br />                            [betTime] => 2014-11-19 05:40:12<br />                            [gameType] => BAC<br />                            [betAmount] => 20<br />                            [validBetAmount] => 19<br />                            [flag] => 1<br />                            [playType] => 1<br />                            [currency] => CNY<br />                            [tableCode] => C3<br />                            [loginIP] => 183.94.238.85<br />                            [recalcuTime] => 2014-11-19 05:40:40<br />                            [platformType] => AGIN<br />                            [remark] => <br />                            [round] => AGQ<br />                            [result] => <br />                        )<br /><br />                )<br /><br />            [4] => SimpleXMLElement Object<br />                (<br />                    [@attributes] => Array<br />                        (<br />                            [dataType] => BR<br />                            [billNo] => 14111905203313<br />                            [playerName] => u8889995<br />                            [agentCode] => 253001001001001<br />                            [gameCode] => GA00314B1909V<br />                            [netAmount] => 19<br />                            [betTime] => 2014-11-19 05:40:12<br />                            [gameType] => BAC<br />                            [betAmount] => 20<br />                            [validBetAmount] => 19<br />                            [flag] => 1<br />                            [playType] => 1<br />                            [currency] => CNY<br />                            [tableCode] => C3<br />                            [loginIP] => 183.94.238.85<br />                            [recalcuTime] => 2014-11-19 05:40:40<br />                            [platformType] => AGIN<br />                            [remark] => <br />                            [round] => AGQ<br />                            [result] => <br />                        )<br /><br />                )<br /><br />            [5] => SimpleXMLElement Object<br />                (<br />                    [@attributes] => Array<br />                        (<br />                            [dataType] => BR<br />                            [billNo] => 14111905203313<br />                            [playerName] => u8889995<br />                            [agentCode] => 253001001001001<br />                            [gameCode] => GA00314B1909V<br />                            [netAmount] => 19<br />                            [betTime] => 2014-11-19 05:40:12<br />                            [gameType] => BAC<br />                            [betAmount] => 20<br />                            [validBetAmount] => 19<br />                            [flag] => 1<br />                            [playType] => 1<br />                            [currency] => CNY<br />                            [tableCode] => C3<br />                            [loginIP] => 183.94.238.85<br />                            [recalcuTime] => 2014-11-19 05:40:40<br />                            [platformType] => AGIN<br />                            [remark] => <br />                            [round] => AGQ<br />                            [result] => <br />                        )<br /><br />                )<br /><br />            [6] => SimpleXMLElement Object<br />                (<br />                    [@attributes] => Array<br />                        (<br />                            [dataType] => BR<br />                            [billNo] => 14111905203313<br />                            [playerName] => u8889995<br />                            [agentCode] => 253001001001001<br />                            [gameCode] => GA00314B1909V<br />                            [netAmount] => 19<br />                            [betTime] => 2014-11-19 05:40:12<br />                            [gameType] => BAC<br />                            [betAmount] => 20<br />                            [validBetAmount] => 19<br />                            [flag] => 1<br />                            [playType] => 1<br />                            [currency] => CNY<br />                            [tableCode] => C3<br />                            [loginIP] => 183.94.238.85<br />                            [recalcuTime] => 2014-11-19 05:40:40<br />                            [platformType] => AGIN<br />                            [remark] => <br />                            [round] => AGQ<br />                            [result] => <br />                        )<br /><br />                )<br /><br />        )<br /><br />)<br /><br />

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Vorheriger Artikel:终竟什么是sql注入Nächster Artikel:这句判断的意思何在