SimpleXMLElement Object
(
    [@attributes] => Array
        (
            [ts_sec] => 1345538437
            [ts_usec] => 720077
        )
 
    [node] => SimpleXMLElement Object
        (
            [@attributes] => Array
                (
                    [index] => 0
                    [name] => bridgesd
                    [from] => local
                )
 
            [item] => SimpleXMLElement Object
                (
                    [@attributes] => Array
                        (
                            [index] => 0
                            [name] => lagg0
                            [handle] => 0
                            [level] => 0
                            [ischild] => 0
                            [parent] => 0
                        )
 
                    [attr] => Array
                        (
                            [0] => SimpleXMLElement Object
                                (
                                    [@attributes] => Array
                                        (
                                            [name] => bytes
                                            [rx] => 159379363180211
                                            [tx] => 38894903367026
                                            [rate_rx] => 3.46MiB
                                            [rate_tx] => 1.43MiB
                                        )
 
                                )
 
                            [1] => SimpleXMLElement Object
                                (
                                    [@attributes] => Array
                                        (
                                            [name] => packets
                                            [rx] => 351830176630
                                            [tx] => 282071482490
                                            [rate_rx] => 6.61K
                                            [rate_tx] => 6.32K
                                        )
 
                                )
 
                            [2] => SimpleXMLElement Object
                                (
                                    [@attributes] => Array
                                        (
                                            [name] => errors
                                            [rx] => 0
                                            [tx] => 81
                                            [rate_rx] => 0
                                            [rate_tx] => 0
                                        )
 
                                )
 
                            [3] => SimpleXMLElement Object
                                (
                                    [@attributes] => Array
                                        (
                                            [name] => drop
                                            [rx] => 0
                                            [tx] => 0
                                            [rate_rx] => 0
                                            [rate_tx] => 0
                                        )
 
                                )
 
                            [4] => SimpleXMLElement Object
                                (
                                    [@attributes] => Array
                                        (
                                            [name] => multicast
                                            [rx] => 0
                                            [tx] => 0
                                            [rate_rx] => 0
                                            [rate_tx] => 0
                                        )
 
                                )
 
                            [5] => SimpleXMLElement Object
                                (
                                    [@attributes] => Array
                                        (
                                            [name] => collisions
                                            [rx] => 0
                                            [tx] => 0
                                            [rate_rx] => 0
                                            [rate_tx] => 0
                                        )
 
                                )
 
                        )
 
                )
 
        )
 
)
上面是我获取到的数据,
下面是我的代码:
include_once ("conn.php");
$arrurl="http://119.188.27.194:88/";
$Contents=file_get_contents($arrurl);
$xml=simplexml_load_string(str_replace('-','',$Contents));  
print_r($xml);
现在要把上面的数据分字段存入数据库,该怎么做?用foreach遍历数组么?
我是小白.只能求助,各种因由啊!!