当前位置: 代码迷 >> PHP >> php获取ftp xml解决办法
  详细解决方案

php获取ftp xml解决办法

热度:132   发布时间:2016-04-28 17:29:42.0
php获取ftp xml
php怎样获取ftp://175.41.22.158/a.xml里面的内容


用户名:test888
密码:test888999
------解决思路----------------------
$url = 'ftp://test888:[email protected]/a.xml';
$s = file_get_contents($url);
$xml = simplexml_load_string("<root>$s</root>");
print_r($xml);
SimpleXMLElement Object
(
    [row] => Array
        (
            [0] => SimpleXMLElement Object
                (
                    [@attributes] => Array
                        (
                            [dataType] => BR
                            [billNo] => 14111905203313
                            [playerName] => u8889995
                            [agentCode] => 253001001001001
                            [gameCode] => GA00314B1909V
                            [netAmount] => 19
                            [betTime] => 2014-11-19 05:40:12
                            [gameType] => BAC
                            [betAmount] => 20
                            [validBetAmount] => 19
                            [flag] => 1
                            [playType] => 1
                            [currency] => CNY
                            [tableCode] => C3
                            [loginIP] => 183.94.238.85
                            [recalcuTime] => 2014-11-19 05:40:40
                            [platformType] => AGIN
                            [remark] => 
                            [round] => AGQ
                            [result] => 
                        )

                )

            [1] => SimpleXMLElement Object
                (
                    [@attributes] => Array
                        (
                            [dataType] => BR
                            [billNo] => 14111905203313
                            [playerName] => u8889995
                            [agentCode] => 253001001001001
                            [gameCode] => GA00314B1909V
                            [netAmount] => 19
                            [betTime] => 2014-11-19 05:40:12
                            [gameType] => BAC
                            [betAmount] => 20
                            [validBetAmount] => 19
                            [flag] => 1
                            [playType] => 1
                            [currency] => CNY
                            [tableCode] => C3
                            [loginIP] => 183.94.238.85
                            [recalcuTime] => 2014-11-19 05:40:40
                            [platformType] => AGIN
                            [remark] => 
                            [round] => AGQ
                            [result] => 
                        )

                )

            [2] => SimpleXMLElement Object
                (
                    [@attributes] => Array
                        (
                            [dataType] => BR
                            [billNo] => 14111905203313
                            [playerName] => u8889995
                            [agentCode] => 253001001001001
                            [gameCode] => GA00314B1909V
                            [netAmount] => 19
                            [betTime] => 2014-11-19 05:40:12
                            [gameType] => BAC
                            [betAmount] => 20
                            [validBetAmount] => 19
                            [flag] => 1
                            [playType] => 1
                            [currency] => CNY
                            [tableCode] => C3
                            [loginIP] => 183.94.238.85
                            [recalcuTime] => 2014-11-19 05:40:40
                            [platformType] => AGIN
                            [remark] => 
                            [round] => AGQ
                            [result] => 
                        )

                )

            [3] => SimpleXMLElement Object
                (
                    [@attributes] => Array
                        (
                            [dataType] => BR
                            [billNo] => 14111905203313
                            [playerName] => u8889995
                            [agentCode] => 253001001001001
                            [gameCode] => GA00314B1909V
                            [netAmount] => 19
                            [betTime] => 2014-11-19 05:40:12
                            [gameType] => BAC
                            [betAmount] => 20
                            [validBetAmount] => 19
                            [flag] => 1
                            [playType] => 1
                            [currency] => CNY
                            [tableCode] => C3
                            [loginIP] => 183.94.238.85
                            [recalcuTime] => 2014-11-19 05:40:40
                            [platformType] => AGIN
                            [remark] => 
                            [round] => AGQ
                            [result] => 
                        )

                )

            [4] => SimpleXMLElement Object
                (
                    [@attributes] => Array
                        (
                            [dataType] => BR
                            [billNo] => 14111905203313
                            [playerName] => u8889995
                            [agentCode] => 253001001001001
                            [gameCode] => GA00314B1909V
                            [netAmount] => 19
                            [betTime] => 2014-11-19 05:40:12
                            [gameType] => BAC
                            [betAmount] => 20
                            [validBetAmount] => 19
                            [flag] => 1
                            [playType] => 1
                            [currency] => CNY
                            [tableCode] => C3
                            [loginIP] => 183.94.238.85
                            [recalcuTime] => 2014-11-19 05:40:40
                            [platformType] => AGIN
                            [remark] => 
                            [round] => AGQ
                            [result] => 
                        )

                )

            [5] => SimpleXMLElement Object
                (
                    [@attributes] => Array
                        (
                            [dataType] => BR
                            [billNo] => 14111905203313
                            [playerName] => u8889995
                            [agentCode] => 253001001001001
                            [gameCode] => GA00314B1909V
                            [netAmount] => 19
                            [betTime] => 2014-11-19 05:40:12
                            [gameType] => BAC
                            [betAmount] => 20
                            [validBetAmount] => 19
                            [flag] => 1
                            [playType] => 1
                            [currency] => CNY
                            [tableCode] => C3
                            [loginIP] => 183.94.238.85
                            [recalcuTime] => 2014-11-19 05:40:40
                            [platformType] => AGIN
                            [remark] => 
                            [round] => AGQ
                            [result] => 
                        )

                )

            [6] => SimpleXMLElement Object
                (
                    [@attributes] => Array
                        (
                            [dataType] => BR
                            [billNo] => 14111905203313
                            [playerName] => u8889995
                            [agentCode] => 253001001001001
                            [gameCode] => GA00314B1909V
                            [netAmount] => 19
                            [betTime] => 2014-11-19 05:40:12
                            [gameType] => BAC
                            [betAmount] => 20
                            [validBetAmount] => 19
                            [flag] => 1
                            [playType] => 1
                            [currency] => CNY
                            [tableCode] => C3
                            [loginIP] => 183.94.238.85
                            [recalcuTime] => 2014-11-19 05:40:40
                            [platformType] => AGIN
                            [remark] => 
                            [round] => AGQ
                            [result] => 
                        )

                )

        )

)

  相关解决方案