(PHP 8 >= 8.3.0)
DOMNode::getRootNode — Get root node
options
This parameter has no effect yet.
Returns the root node.
Exemple #1 DOMNode::getRootNode() example
<?php
$dom = new DOMDocument();
$dom->loadXML('<?xml version="1.0"?><html><body/></html>');
var_dump($dom->documentElement->firstElementChild->getRootNode() === $dom);
?>
L'exemple ci-dessus va afficher :
bool(true)