Query Empty - ThomasWeinert/FluentDOM GitHub Wiki
FluentDOM\Query empty();
Remove all child nodes from the set of matched elements.
$html = <<<HTML
<html>
<head>
<title>Examples: FluentDOM\Query::empty()</title>
</head>
<body>
<p class="first">Hello One</p>
<p>Hello Two</p>
</body>
</html>
HTML;
echo FluentDOM($html)
->find('//p[@class = "first"]')
->empty();
<?xml version="1.0"?>
<html>
<head>
<title>Examples: FluentDOM\Query::empty()</title>
</head>
<body>
<p class="first"></p>
<p>Hello Two</p>
</body>
</html>