Get value from SimpleXMLElement Object

You have to cast simpleXML Object to a string.

$value = (string) $xml->code[0]->lat;

Leave a Comment