1 .*<\/" . $x . ">/", $con, $temp);11 $arr[] = $temp[0];12 }13 //去除XML标签并组装数据14 $data = array();15 foreach ($arr as $key => $value) {16 foreach ($value as $k => $v) {17 $a = explode($xmlTag[$key] . '>', $v);18 $v = substr($a[1], 0, strlen($a[1]) - 2);19 $data[$k][$xmlTag[$key]] = $v;20 }21 }22 $jsonstr = $data[0]['execProc_stringResult'];23 $arr = json_decode($jsonstr, true);24 var_dump($arr);
php xml转数组 自定义xml_to_array
欢迎沟通交流