ericmorand/xml-to-array
Composer 安装命令:
composer require ericmorand/xml-to-array
包简介
Simple XML-to-array converter
README 文档
README
This package provides a very simple converter to convert an XML string to an array. No attributes support, no complex logic, just a plain and simple converter that just works.
Installation
composer require ericmorand/xml-to-array
Usage
<?php use EricMorand\XMLToArray; $converter = new XMLToArray\Converter(); $xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?> <foo> <prop0/> <prop1>foo</prop1> <prop2><![CDATA[foo]]></prop2> <prop3> <prop0/> <prop1>foo</prop1> <prop2><![CDATA[foo]]></prop2> </prop3> </foo>"; $array = $converter->convertXML($xml);
By running this code, $array would contain:
[
'prop0' => null,
'prop1' => 'foo',
'prop2' => 'foo',
'prop3' => [
'prop0' => null,
'prop1' => 'foo',
'prop2' => 'foo'
]
]
统计信息
- 总下载量: 297
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: ISC
- 更新时间: 2019-02-27