DOMParentNode::prepend
PHP function
Edit on GitHub ✎
(PHP 8)
Prepends nodes before the first child node
Description
DOMParentNode::prepend(DOMNode|string ...$nodes): void
Prepends one or many nodes to the list of children before the first child node.
Parameters
nodesThe nodes to prepend. 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 an owner document now works. Previous_hierarchy_exception |
See Also
DOMParentNode::append