Are you wanting to get the name of the root node?
$xml = simplexml_load_string($str);
echo $xml->getName();
More Related Contents:
- Reference – How do I handle Namespaces (Tags and Attributes with a Colon in their Name) in SimpleXML?
- Remove a child with a specific attribute, in SimpleXML for PHP
- Simple XML – Dealing With Colons In Nodes
- Get value from SimpleXMLElement Object
- Forcing a SimpleXML Object to a string, regardless of context
- Parse XML with Namespace using SimpleXML [duplicate]
- How to get the value of an attribute from XML file in PHP?
- parse an XML with SimpleXML which has multiple namespaces [duplicate]
- PHP namespace simplexml problems
- Implementing condition in XPath [duplicate]
- How can I set text value of SimpleXmlElement without using its parent?
- Using SimpleXML to read RSS feed
- PHP SimpleXML: insert node at certain position
- ‘xmlParseEntityRef: no name’ warnings while loading xml into a php file
- SimpleXML: Working with XML containing namespaces
- How to Paginate lines in a foreach loop with PHP
- Loop through an XML object with SimpleXML
- PHP convert XML to JSON group when there is one child
- simplexml error handling php
- PHP SimpleXML Namespace Problem
- Getting the text portion of a node using php Simple XML
- PHP, SimpleXML, decoding entities in CDATA
- Getting actual value from PHP SimpleXML node [duplicate]
- php SimpleXML attributes are missing
- PHP SimpleXML + Get Attribute
- How to get attribute of node with namespace using SimpleXML? [closed]
- adding a namespace when using SimpleXMLElement
- “At sign” @ in SimpleXML object?
- simple xml add namespaced child
- How to import XML string in a php DOMDocument