I tried to use unlink_node to delete a node, but it never worked.
However, you can delete a node with this:
function delNode($node){
$nud=$node->parent_node();
$nud->remove_child($node);
}
DomNode->unlink_node
(No version information available, might be only in CVS)
DomNode->unlink_node — Deletes node
Description
void DomNode->unlink_node
( void
)
Warning
This function is currently not documented; only its argument list is available.
DomNode->unlink_node
starloran at hotmail dot com
01-Oct-2004 09:46
01-Oct-2004 09:46
phpnotes AT no Spam dot phillfox.net
22-Nov-2002 05:07
22-Nov-2002 05:07
Just like dump_node*, this method requres the node as an argument.
Like this:
$removeThis = $dom->get_element_by_id ('26');
$unlinked = $removeThis->unlink_node($removeThis);
In the example above, $unlinked seems to be NULL.
I'm using 4.3.0-dev (build: Nov 14 2002 10:13:12) in Module mode on Apache/1.3.24 - Win2000.
* see: http://www.php.net/manual/en/function.domnode-dump-node.php
