mrgenis / xml-to-array-schema
Convert xml document to array
Installs: 2 136
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=7.0
- ext-dom: *
- ext-mbstring: *
- ext-simplexml: *
- ext-xmlreader: *
- ext-xmlwriter: *
- lib-libxml: >=2.6.20
Requires (Dev)
- phpunit/phpunit: 4.1.3
This package is not auto-updated.
Last update: 2025-04-22 11:01:07 UTC
README
Convert xml document to associative array.
The function automatically detects the schematic of the document and uses it to format the elements that may appear more than once in an index array.
If it is not possible to detect the scheme, it generates an array of those elements that appear more than once in the form of an indexed array.
composer require mrgenis/xml-to-array-schema
Example
- \DomDocument
- \SimpleXMLElement
- string
$data = \MrGenis\Library\XmlToArray::convert($xml);