The getDocNamespaces() function returns the namespaces declared in an XML document.
public array SimpleXMLElement::getDocNamespaces ([ bool $recursive = FALSE [, bool $from_root = TRUE ]] )
Returns namespaces declared in document
Parameter | Description |
---|---|
recursive | If specified, returns all namespaces declared in parent and child nodes. Otherwise, returns only namespaces declared in root node. |
from_root | Allows you to recursively check namespaces under a child node instead of from the root of the XML doc. |
The getDocNamespaces method returns an array of namespace names with their associated URIs.