Get value from SimpleXMLElement Object October 11, 2022 by Tarik You have to cast simpleXML Object to a string. $value = (string) $xml->code[0]->lat;