simplexml_import_dom

PHP 5, PHP 7, PHP 8
simplexml_import_dom - Get a SimpleXMLElement object from a DOM node
Manual
Code Examples

simplexml_import_dom(
     SimpleXMLElement|DOMNode$node,
     [string|null$class_name = SimpleXMLElement::class]
): SimpleXMLElement|null

This function takes a node of a DOM document and makes it into a SimpleXML node. This new object can then be used as a native SimpleXML element.

Parameters

node

A DOM Element node

class_name

You may use this optional parameter so that simplexml_import_dom will return an object of the specified class. That class should extend the SimpleXMLElement class.

Return Values

Returns a SimpleXMLElement or null on failure.

Related Functions

Example of simplexml_import_dom

Show all examples for simplexml_import_dom

PHP Version:


Function simplexml_import_dom:

SimpleXML Functions

Most used PHP functions