<?php
header("Content-Type:text/html;charset=utf-8");
function xml2array($filename){ 
$xml = @simplexml_load_file($filename); 
//返回数组 
if(is_object($xml)){ 
$xml = json_encode($xml); 
$xml = json_decode($xml, true); 
} 
if(!is_array($xml)) $xml = null; 
return $xml; 
}

$path = 'f.xml';
echo '<pre>';
var_dump(xml2array($path));



?>

 

相关文章:

  • 2022-12-23
  • 2021-10-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-05
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-02
  • 2021-06-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案