(PHP 8 >= 8.3.0)
DOMNode::getRootNode — Get root node
options
This parameter has no effect yet.
Returns the root node.
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)
Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!
Check out: eBank.nz (Art Generator) |
Netwrck.com (AI Tools) |
Text-Generator.io (AI API) |
BitBank.nz (Crypto AI) |
ReadingTime (Kids Reading) |
RewordGame |
BigMultiplayerChess |
WebFiddle |
How.nz |
Helix AI Assistant