DOMNode::removeChild

(PHP 5, PHP 7, PHP 8)

DOMNode::removeChild Removes child from list of children

說明

public DOMNode::removeChild(DOMNode $child): DOMNode|false

This functions removes a child from a list of children.

參數(shù)

child

The removed child.

返回值

If the child could be removed the function returns the old child.

錯(cuò)誤/異常

DOM_NO_MODIFICATION_ALLOWED_ERR

Raised if this node is readonly.

DOM_NOT_FOUND

Raised if child is not a child of this node.

范例

The following example will delete the chapter element of our XML document.

參見