function xmltoarr($path){//xml字符串转数组
$xmlfile = file_get_contents($path);//提取xml文档中的内容以字符串格式赋给变量
$ob= simplexml_load_string($xmlfile,'SimpleXMLElement', LIBXML_NOCDATA);//将字符串转化为变量
$json = json_encode($ob);//将对象转化为JSON格式的字符串
$configData = json_decode($json, true);//将JSON格式的字符串转化为数组
return $configData;
}

相关文章:

  • 2022-01-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-28
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-06
  • 2022-12-23
  • 2021-12-24
  • 2022-01-03
相关资源
相似解决方案