/**
* 将xml转为array
* @param string $xml
* @throws Exception
*/
public function FromXml($xml)
{
  if (!$xml) {
    throw new Exception("xml数据异常!");
  }
  //将XML转为array
  //禁止引用外部xml实体
  libxml_disable_entity_loader(true);
  return json_decode(json_encode(simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA)), true);
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-11
  • 2021-07-17
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-27
  • 2022-03-10
  • 2022-12-23
相关资源
相似解决方案