Tutorial Extension  1.0.0
SellerDeck Extensions - Tutorial Extension
Static Public Member Functions | List of all members
Array2XML Class Reference

Static Public Member Functions

static init ($version= '1.0', $encoding= 'UTF-8', $format_output=true)
 
static & createXML ($node_name, $arr=array(), $namespace=null)
 

Detailed Description

Definition at line 37 of file Array2XML.php.

Member Function Documentation

static& createXML (   $node_name,
  $arr = array(),
  $namespace = null 
)
static

Convert an Array to XML

Parameters
string$node_name- name of the root node to be converted
array$arr- aray to be converterd
Returns
DomDocument

Definition at line 62 of file Array2XML.php.

63  {
64  $xml = self::getXMLRoot();
65  $xml->appendChild(self::convert($node_name, $arr, $namespace));
66 
67  self::$xml = null; // clear the xml node in the class for 2nd time use.
68  return $xml;
69  }
static init (   $version = '1.0',
  $encoding = 'UTF-8',
  $format_output = true 
)
static

Initialize the root XML node [optional]

Parameters
$version
$encoding
$format_output

Definition at line 49 of file Array2XML.php.

50  {
51  self::$xml = new \DomDocument($version, $encoding);
52  self::$xml->formatOutput = $format_output;
53  self::$encoding = $encoding;
54  }

The documentation for this class was generated from the following file: