PHP Class LSS\XML2Array

See Array2XML: http://www.lalit.org/lab/convert-php-array-to-xml-with-attributes Author : Lalit Patel Website: http://www.lalit.org/lab/convert-xml-to-array-in-php-xml2array License: Apache License 2.0 http://www.apache.org/licenses/LICENSE-2.0 Version: 0.1 (07 Dec 2011) Version: 0.2 (04 Mar 2012) Fixed typo 'DomDocument' to 'DOMDocument' Usage: $array = XML2Array::createArray($xml);
Mostra file Open project: openlss/lib-array2xml Class Usage Examples

Protected Properties

Property Type Description
$encoding
$prefix_attributes
$xml

Public Methods

Method Description
createArray ( $input_xml, $options ) : DOMDocument Convert an XML to Array
init ( $version = '1.0', $encoding = 'UTF-8', $format_output = true ) Initialize the root XML node [optional]

Protected Methods

Method Description
convert ( mixed $node ) : mixed Convert an Array to XML
getXMLRoot ( ) * Get the root XML node, if there isn't one, create it.

Method Details

convert() protected static method

Convert an Array to XML
protected static convert ( mixed $node ) : mixed
$node mixed - XML as a string or as an object of DOMDocument
return mixed

createArray() public static method

Convert an XML to Array
public static createArray ( $input_xml, $options ) : DOMDocument
return DOMDocument

getXMLRoot() protected static method

* Get the root XML node, if there isn't one, create it.
protected static getXMLRoot ( )

init() public static method

Initialize the root XML node [optional]
public static init ( $version = '1.0', $encoding = 'UTF-8', $format_output = true )
$version
$encoding
$format_output

Property Details

$encoding protected_oe static_oe property

protected static $encoding

$prefix_attributes protected_oe static_oe property

protected static $prefix_attributes

$xml protected_oe static_oe property

protected static $xml