| Newsgroups |
php.notes |
| Message-ID |
<[email protected]> |
How do you check if a DOMNode is still valid?
$node->parentNode->removeChild($node);
After that line, isset($node) == true (because $node is still an object of a type of DOMNode, just with no properties)
I can do isset($node->nodeValue), but that results in a warning:
Warning: Couldn't fetch DOMElement. Node no longer exists
Is there a better way to check to see if a node is still valid? I would especially like one that doesnt result in a warning or notice.
----
Server IP: 69.147.83.197
Probable Submitter: 67.164.122.149
----
Manual Page -- http://www.php.net/manual/en/class.domnode.php
Edit -- https://master.php.net/note/edit/86258
Del: integrated -- https://master.php.net/note/delete/86258/integrated
Del: useless -- https://master.php.net/note/delete/86258/useless
Del: bad code -- https://master.php.net/note/delete/86258/bad+code
Del: spam -- https://master.php.net/note/delete/86258/spam
Del: non-english -- https://master.php.net/note/delete/86258/non-english
Del: in docs -- https://master.php.net/note/delete/86258/in+docs
Del: other reasons-- https://master.php.net/note/delete/86258
Reject -- https://master.php.net/note/reject/86258
Search -- https://master.php.net/manage/user-notes.php