0
我使用梨串行反序列化這個XMLXML反序列化的PHP梨屬性
<Response Version="3">
<RespClientID>
<DID>XXXXXXXXXXXXXXXXXX</DID>
<ClientRef>XXXXXXXXXXXX</ClientRef>
</RespClientID>
<Status StatusCode="OK"/>
<RegistrationResponse>
<DID>XXXXXXXXXXXXXXXXXX</DID>
<URL>https://.....</URL>
<URL>https://.....</URL>
</RegistrationResponse>
如何在狀態標籤獲得的StatusCode?
這是我的代碼:
$registration = registration();
$options = array(
XML_UNSERIALIZER_OPTION_COMPLEXTYPE => 'object',
XML_UNSERIALIZER_OPTION_ATTRIBUTE_CLASS => '_classname'
);
$unserializer = new XML_Unserializer($options);
$result = $unserializer->unserialize($registration);
if($result) {
$data = $unserializer->getUnserializedData();
}