An interface that can get the returned XML file, how to extract useful content?
After the interface is called, $result = can get the following:
StdClass Object
(
[out] = =
?
? T
)
Previously done this directly read the XML, but this brings a StdClass Object ([out] = =
I don't know how to read the contents of each node.
------Solution--------------------
If you are unfamiliar with object manipulation, it can be easier to convert an array first.
The object you get is very simple, $result->out is the XML string, if you want to extract the content, you can try to extract the string, or parse the XML to the object and then to the array (recommended).
http://www.php.net/manual/zh/language.oop5.properties.php
------Solution--------------------
Direct printing
echo $result->out;
Parsing as XML
$xml = simplexml_load_string ($result->out);
Print_r ($xml);
simplexmlelement object
(
[flights] = simplexmlelement Object
(
[Flight] = simplexmlelement Object
(
[@attributes] + = Array
(
[orgcity] = SHA
[departterm] => ; T2
[dstcity] = CAN
[Arrivalterm] =--
[Aircomp] = MU
[Flightno] = MU5307
[Planetype] = [+]