标签:
$data = simplexml_load_string($res, ‘SimpleXMLElement‘, LIBXML_NOCDATA); $arr = converArray($data); function converArray($xmlData) { foreach((array)$xmlData as $val=>$key) { if(!is_string($key)) { $arr =converArray($key); $list[$val] = $arr; } else { $list[$val] = $key; } } return $list; }
标签:
原文地址:http://www.cnblogs.com/whlives/p/5015771.html