xml转化为数组

function xml_to_array($xml)
{
    return json_decode(json_encode(simplexml_load_string($xml)), true);
}
原文地址:https://www.cnblogs.com/liaokaichang/p/6801760.html