Here's the response from a WSDL
<return code='6000'></return>
I would like to return the code value. Can i use simplexml_load_string()
?
Here's the response from a WSDL
<return code='6000'></return>
I would like to return the code value. Can i use simplexml_load_string()
?
You can use DOMDocument() to get node values as well as attribute values.
$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');
}