[英]PHP - How to extract the reponse code from nusoap response?
这是WSDL的响应
<return code='6000'></return>
我想返回代码值。 我可以使用simplexml_load_string()
吗?
您可以使用DOMDocument()获取节点值以及属性值。
$dom_boj=new DOMDocument(); //Creating object to the class DOMDocument()
$dom_boj->loadXML($XMLResponse); // loading your response using loadXML
//Traversing all return tags.
foreach($dom_boj->getElementByTagName('return') as $tagName)
{
echo $tagName->getAttribute('code');
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.