Get root node of XML doc using simplexml

Are you wanting to get the name of the root node?

$xml = simplexml_load_string($str);
echo $xml->getName();

Leave a Comment