Jak wyciągnąć z tej tablicy zmienną Waybill ?
SimpleXMLElement Object ( [Status] => OK [SessionId] => 1311248 [Packages] => SimpleXMLElement Object ( [Package] => SimpleXMLElement Object ( [Status] => OK [PackageId] => 1036747 [Parcels] => SimpleXMLElement Object ( [Parcel] => SimpleXMLElement Object ( [Status] => OK [ParcelId] => 1393632 [Waybill] => 0000000525831Q ) ) ) ) )
$xml = simplexml_load_string($result->return); http://www.php.net/print_r($xml); $status = $xml->Status;
https://stackoverflow.com/questions/37810680/get-value-from-xml-array-in-php
Możesz odwoływać się po kolei po węzłach:
$waybill = (string)$xml->Packages->Parcels->Parcell->Waybill;
$waybill = (string)$xml->xpath('*/Waybill'){0};
Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)