When I print_r() the SimpleXMLElement object referenced by the $xmlObject variable, I see the following structure:
SimpleXMLElement Object ( [@attributes] => Array ( [uri] => /example ) [result] => SimpleXMLElement Object ( [message] => Record(s) added successfully [recorddetail] => Array ( [0] => SimpleXMLElement Object ... ) ) )
Notice how the property $xmlObject->result->message looks like, it's just a string. However, if I do print_r($xmlObject->result->message) , I get the following:
SimpleXMLElement Object ( [0] => Record(s) added successfully )
So at this moment I am confused. Why is $xmlObject->result->message identified as an instance of SimpleXMLElement Object in this case, when the print result of the full $xmlObject does not imply this?
And how do I access this value? I tried $xmlObject->result->message[0] , but it just prints the same thing (i.e. the last piece of code that I posted).
maxedison
source share