You have to cast simpleXML Object to a string.
$value = (string) $xml->code[0]->lat;
More Related Contents:
- Simple XML – Dealing With Colons In Nodes
- How to use XMLReader in PHP?
- PHP simpleXML how to save the file in a formatted way?
- PHP library for parsing XML with a colons in tag names? [duplicate]
- SimpleXML – Remove xpath node
- Error: “Input is not proper UTF-8, indicate encoding !” using PHP’s simplexml_load_string
- SimpleXML and print_r() – why is this empty?
- How to write CDATA using SimpleXmlElement?
- What’s the difference between PHP’s DOM and SimpleXML extensions?
- Accessing @attribute from SimpleXML
- Best way to process large XML in PHP [duplicate]
- Updating XML node with PHP
- SimpleXML how to prepend a child in a node?
- Using SimpleXML to load remote URL
- PHP – Processing Invalid XML
- PHP convert XML to JSON group when there is one child
- Using SimpleXML to create an XML object from scratch
- PHP, SimpleXML, decoding entities in CDATA
- PHP get values from SimpleXMLElement array
- PHP SimpleXML + Get Attribute
- SimpleXML get element content based on attribute value [duplicate]
- converting SOAP XML response to a PHP object or array
- SimpleXML SOAP response Namespace issues
- How to get attribute of node with namespace using SimpleXML? [closed]
- Format output of $SimpleXML->asXML(); [duplicate]
- How to save changed SimpleXML object back to file?
- Remove namespace from XML using PHP
- adding a namespace when using SimpleXMLElement
- “At sign” @ in SimpleXML object?
- simple xml add namespaced child