使用simplexml傳遞SOAP響應之後,我得到了以下輸出。我怎樣才能得到域的屬性值,即名稱和效用。使用使用Simple XML解析SOAP響應PHP
代碼:在返回
$xmlString = preg_replace("/(<\/?)(\w+):([^>]*>)/", "$1$2$3", $result);
$xml = simplexml_load_string($xmlString);
print_r($xml);
SimpleXMLElement Object([soapBody] => SimpleXMLElement Object ([CheckAvailabilityResponse] => SimpleXMLElement Object([CheckAvailabilityResult] => <?xml version="1.0" encoding="UTF-16"?>
<check>
<domain name="MYNAMEISNIJIL.COM" avail="1" canBackorder="0"/>
</check>)))
+1對於醜陋而又巧妙的SneakyFauxSoap hack :) – Sergio 2012-10-31 13:46:22