DOMChildNode::before
PHP function
Edit on GitHub ✎
(PHP 8)
Adds nodes before the node
Description
DOMChildNode::before(DOMNode|string ...$nodes): void
Adds the passed nodes before the node.
Parameters
nodesNodes to be added before the node. Strings are automatically converted to text nodes.
Return Values
Void
Errors/Exceptions
Changelog
| Version | Description |
|---|---|
| 8.3.0 | Calling this method on a node without a parent is now a no-op to align the behaviour with the DOM specification. Previous_hierarchy_exception |
See Also
DOMChildNode::afterDOMChildNode::removeDOMChildNode::replaceWith