如果你使用 curl 获取的 xml data
$xml = simplexml_load_string($data);
$data['tk'] = json_decode(json_encode($xml),TRUE);
 
如果是直接获取 URL 数据的话
$xml = simplexml_load_file($data);
$data['tk'] = json_decode(json_encode($xml),TRUE);
 
先把 simplexml 对象转换成 json,再将 json 转换成数组。

相关文章:

  • 2022-12-23
  • 2023-03-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-26
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-02-02
  • 2021-07-14
  • 2021-06-22
  • 2021-12-17
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案