xml转array

1、字串

$xml = simplexml_load_string($data);
$array = json_decode(json_encode($xml),TRUE);

2、文件
$xml = simplexml_load_file($data);
$array= json_decode(json_encode($xml),TRUE);

原文地址:https://www.cnblogs.com/loweringye/p/5841398.html