children() function in PHP XMLFrom a XML string or tag we can get the children of a given node. We will be using simpleXMLElement object for this. Here is the XML string.
We have also used getName to display the tag name along with the children function. Here is the php code.