DOMNode::getRootNode
(PHP 8 >= 8.3.0)
DOMNode::getRootNode — Get root node
Parameters
options
This parameter has no effect yet.
Return Values
Returns the root node.
Examples
Example #1 DOMNode::getRootNode() example
<?php
$dom = new DOMDocument();
$dom->loadXML('<?xml version="1.0"?><html><body/></html>');
var_dump($dom->documentElement->firstElementChild->getRootNode() === $dom);
?>The above example will output:
bool(true)
来源:PHP Documentation Group · 作者与贡献记录 · CC BY 3.0。离线整理了版式、链接和媒体显示。
