Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 3.144.89.197
---
title: remove
---
```php
remove ( )
```
Removes the current node recursively from the DOM.
Does nothing if the node has no parent (root node);
**Example**
```php
$html->load(<<<EOD
<html>
<body>
<table>
<tr><th>Title</th></tr>
<tr><td>Row 1</td></tr>
</table>
</body>
</html>
EOD
);
$table = $html->find('table', 0);
$table->remove();
echo $html;
/**
* Returns
*
* <html> <body> </body> </html>
*/
```
**Remarks**
* Whitespace immediately **before** the removed node will remain in the DOM.
|