SimpleXMLElement::getNamespaces Returns namespaces used in document &reftitle.description; public arraySimpleXMLElement::getNamespaces boolrecursive&false; Returns namespaces used in document &reftitle.parameters; recursive If specified, returns all namespaces used in parent and child nodes. Otherwise, returns only namespaces used in root node. &reftitle.returnvalues; The getNamespaces method returns an array of namespace names with their associated URIs. &reftitle.examples; Get document namespaces in use John Doe Susie Q. Public XML; $sxe = new SimpleXMLElement($xml); $namespaces = $sxe->getNamespaces(true); var_dump($namespaces); ?> ]]> &example.outputs; string(21) "http://example.org/ns" } ]]> &reftitle.seealso; SimpleXMLElement::getDocNamespaces SimpleXMLElement::registerXPathNamespace