CrossPHP

Array2XML
in package

Table of Contents

$encoding  : mixed
$xml  : mixed
createXML()  : DomDocument
Convert an Array to XML
init()  : mixed
Initialize the root XML node [optional]
bool2str()  : mixed
convert()  : DOMNode
Convert an Array to XML
getXMLRoot()  : mixed
isValidTagName()  : mixed

Properties

$encoding

private static mixed $encoding = 'UTF-8'

Methods

createXML()

Convert an Array to XML

public static createXML(mixed $nodeName[, array<string|int, mixed> $arr = [] ]) : DomDocument
Parameters
$nodeName : mixed
  • name of the root node to be converted
$arr : array<string|int, mixed> = []
  • array to be converterd
Tags
throws
Exception
Return values
DomDocument

init()

Initialize the root XML node [optional]

public static init([ $version = '1.0' ][,  $encoding = 'UTF-8' ][,  $formatOutput = true ]) : mixed
Parameters
$version : = '1.0'
$encoding : = 'UTF-8'
$formatOutput : = true
Return values
mixed

bool2str()

private static bool2str(mixed $v) : mixed
Parameters
$v : mixed
Return values
mixed

convert()

Convert an Array to XML

private static convert(mixed $nodeName[, array<string|int, mixed> $arr = [] ]) : DOMNode
Parameters
$nodeName : mixed
  • name of the root node to be converted
$arr : array<string|int, mixed> = []
  • aray to be converterd
Tags
throws
Exception
Return values
DOMNode

getXMLRoot()

private static getXMLRoot() : mixed
Return values
mixed

isValidTagName()

private static isValidTagName(mixed $tag) : mixed
Parameters
$tag : mixed
Return values
mixed

Search results