Namespace are used in XML document to avoid conflict of name used by different XML developers. For example name element can have name of the student or it can have name of the fruits in basket.
We will discuss more on how to get namespace details by using PHP. Here is the example to get namespace from our XML file. We have used one more sample file which used namespace in its elements.
By using recursive to TRUE we will get name space of total documents including all child nodes. By making it FALSE it will return only root node namespaces.