digitickets / lalit
GitHub copy of LaLit's XML2Array and Array2XML
Installs: 754 783
Dependents: 13
Suggesters: 0
Security: 0
Stars: 72
Watchers: 8
Forks: 38
Open Issues: 0
Requires
- php: >=7
- ext-dom: *
Requires (Dev)
README
\digitickets\LaLit
allows you to convert XML to a PHP array and back again.
The base code was developed by Lalit Patel and is available from http://www.lalit.org/lab/
XML2Array : http://www.lalit.org/lab/convert-xml-to-array-in-php-xml2array/ Array2XML : http://www.lalit.org/lab/convert-php-array-to-xml-with-attributes/
I've added additional unit tests via a generator (so probably too many tests)
Extended usage
Alternative labelling
As of v3.2.0, the init()
method has been expanded to allow the labels used in the output XML2Array::createArray()
and
the input to Array2XML::createXML()
to be changed. Any value, where null
is supplied will revert to the default value.
Version History
Please read the CHANGELOG document.
@todo
- Add support for
<!-- comments -->
within the XML, such that when converting from XML -> PHP -> XML, the comments are preserved.