$xml = 'soap文件';
$xmlObj = simplexml_load_string($xml);
$xmlObj->registerXPathNamespace('soap', 'http://schemas.xmlsoap.org/soap/envelope/');
$result = $xmlObj->xpath("soap:Body");
$results = object_to_array($result);
/**
* 对象 转 数组
*
* @param object $obj 对象
* @return array
*/
function object_to_array($obj) {
$obj = (array)$obj;
foreach ($obj as $k => $v) {
if (gettype($v) == 'resource') {
return;
}
if (gettype($v) == 'object' || gettype($v) == 'array') {
$obj[$k] = (array)object_to_array($v);
}
}
return $obj;
}
---------------------
原文:https://blog.csdn.net/qq_18105691/article/details/83347521
soap 返回报文解析
最新推荐文章于 2023-10-26 18:46:59 发布