<?php
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
$xml = 'site_1.xml';
        $myxml = simplexml_load_file($xml);
       // print_r($myxml);
       
   
        print_r(xmlToArray($myxml));
   
    function xmlToArray($xml){
       $arr_xml = (array)$xml;
       foreach($arr_xml as $key=>$item){
           if(is_object($item) || is_array($item)){
               $arr_xml[$key] = xmlToArray($item);
           }
       }
       return $arr_xml;
   }
   
?>

  

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2022-12-23
  • 2022-02-19
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-04-29
  • 2022-12-23
  • 2021-06-14
  • 2021-10-29
相关资源
相似解决方案