PHP 8.5.0 Beta 1 available for testing

Voting

: max(eight, two)?
(Example: nine)

The Note You're Voting On

blaine (at) blainegarrett (dot com)
19 years ago
This might be obvious, but might help someone as well...

If you simply have a node that you need to remove (perhaps from an xpath) and don't know the parent node offhand (the examples seem to assume you have the parent in a variable), then you can do something easy like this...

$node->parentNode->removeChild($node);

parentNode is a scalar property of the Element.

Hope that helps.

--
Blaine Garrett

<< Back to user notes page

To Top