|
DOMDocument::createElementCreate new element node Description
public DOMElement DOMDocument::createElement
( string
$name
[, string $value
] )This function creates a new instance of class DOMElement. This node will not show up in the document unless it is inserted with (e.g.) DOMNode::appendChild. Parameters
Return Values
Returns a new instance of class DOMElement or Errors/Exceptions
Examples
Example #1 Creating a new element and inserting it as root
<?php The above example will output: <?xml version="1.0" encoding="utf-8"?> <test>This is the root element!</test> Notes
See Also
|