Query Remove - ThomasWeinert/FluentDOM GitHub Wiki
FluentDOM\Query remove([ string $selector = NULL ]);
Removes all matched elements from the DOM.
$html = <<<HTML
<html>
<head>
<title>Examples: FluentDOM\Query::remove()</title>
</head>
<body>
<p class="first">Hello One</p>
<p>Hello Two</p>
</body>
</html>
HTML;
echo FluentDOM($html)
->find('//p[@class = "first"]')
->remove();
<?xml version="1.0"?>
<html>
<head>
<title>Examples: FluentDOM\Query::remove()</title>
</head>
<body>
<p>Hello Two</p>
</body>
</html>