class Xml

Methods

static string
toXml(mixed $data, SimpleXMLElement|null $parentNode = null, string $root = 'root')

Convert the given data to an XML string.

static array
toArray(string $xml)

Convert the given XML string to an array.

Details

at line 17
static string toXml(mixed $data, SimpleXMLElement|null $parentNode = null, string $root = 'root')

Convert the given data to an XML string.

Parameters

mixed $data
SimpleXMLElement|null $parentNode
string $root

Return Value

string

at line 49
static array toArray(string $xml)

Convert the given XML string to an array.

Parameters

string $xml

Return Value

array

Exceptions

InvalidArgumentException