PluginProbe
BerqWP – All-In-One Optimization for Core Web Vitals, Cache, CDN, Images, CSS & JavaScript / 1.9.7
BerqWP – All-In-One Optimization for Core Web Vitals, Cache, CDN, Images, CSS & JavaScript v1.9.7
4.1.16 4.1.15 4.1.14 4.1.13 4.1.12 4.1.11 4.1.10 4.0.30 4.0.29 4.0.28 4.0.27 4.0.26 4.0.24 4.0.25 4.0.23 4.0.22 4.0.21 4.0.19 4.0.18 4.0.17 4.0.16 1.9.3 1.9.4 1.9.5 1.9.6 All 170 releases
searchpro / simplehtmldom / manual / docs / api / simple_html_dom_node / removeChild.md

removeChild.md in BerqWP – All-In-One Optimization for Core Web Vitals, Cache, CDN, Images, CSS & JavaScript 1.9.7, at simplehtmldom/manual/docs/api/simple_html_dom_node/removeChild.md

43 lines 708 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 # removeChild
2
3 ```php
4 removeChild ( object $node )
5 ```
6
7 | Parameter | Description
8 | --------- | -----------
9 | `node` | Node to remove from current element, must be a child of the current element.
10
11 Removes the node recursively from the DOM.
12 Does nothing if the provided node is not a child of the current node.
13
14 **Example**
15
16 ```php
17 $html = str_get_html(<<<EOD
18 <html>
19 <body>
20 <table>
21 <tr><th>Title</th></tr>
22 <tr><td>Row 1</td></tr>
23 </table>
24 </body>
25 </html>
26 EOD
27 );
28
29 $body = $html->find('body', 0);
30 $body->removeChild($body->find('table', 0));
31
32 echo $html;
33
34 /**
35 * Returns
36 *
37 * <html> <body> </body> </html>
38 */
39 ```
40
41 **Remarks**
42
43 * Whitespace immediately **before** the removed node will remain in the DOM.