I have this output when reading an XML file.
SimpleXMLElement Object
(
[GetAllDomains] => SimpleXMLElement Object
(
[DomainDetail] => Array
(
[0] => SimpleXMLElement Object
(
[DomainName] => domain1.com
[DomainNameID] => 153033597
[expiration-date] => 3/1/2017 2:23:56 PM
[lockstatus] => Locked
[AutoRenew] => Yes
)
[1] => SimpleXMLElement Object
(
[DomainName] => domain2.com
[DomainNameID] => 153043233
[expiration-date] => 5/25/2017 5:45:00 PM
[lockstatus] => Not Locked
[AutoRenew] => Yes
)
)
[domaincount] => 2
[UserRequestStatus] => DomainBox
)
[Command] => GETALLDOMAINS
[APIType] => API
[Language] => eng
[ErrCount] => 0
[ResponseCount] => 0
[MinPeriod] => SimpleXMLElement Object
(
)
[MaxPeriod] => 10
[Server] => SJL0VWRESELL_T1
[Site] => eNom
[IsLockable] => SimpleXMLElement Object
(
)
[IsRealTimeTLD] => SimpleXMLElement Object
(
)
[TimeDifference] => +0.00
[ExecTime] => 0.094
[Done] => true
[RequestDateTime] => 5/25/2015 9:47:21 AM
[debug] => SimpleXMLElement Object
(
)
)
the above output is being shown by using the print_r
function in PHP
how can i loop through the array of DomainDetail
in PHP using a foreach
loop
i tried using print_r($xml->DomainDetail);
and print_r($xml["DomainDetail"]);
but nothing is being shown using this print_r