alyjee/from-xml-to-array
Composer 安装命令:
composer require alyjee/from-xml-to-array
包简介
Conversion from xml to array
README 文档
README
A package inspired by vyuldashev/xml-to-array to convert an xml to array
Inspired by Vyuldashev's xml-to-array ❤️
Install
You can install this package via composer.
composer require alyjee/from-xml-to-array
Usage
use Alyjee\XmlToArray\XmlToArray; $xml = '<items><Facilities><Facility Code="*EC"><![CDATA[Earliest check-in at 14:00]]></Facility><Facility Code="*LF"><![CDATA[1 lift]]></Facility><Facility Code="*RS"><![CDATA[Room Service from 18:00 to 21:00]]></Facility></Facilities></items>'; $result = XmlToArray::convert($xml);
After running this piece of code $result will contain:
Array ( [items] => Array ( [Facilities] => Array ( [Facility] => Array ( [0] => Array ( [_attributes] => Array ( [Code] => *EC ) [_cdata] => Earliest check-in at 14:00 ) [1] => Array ( [_attributes] => Array ( [Code] => *LF ) [_cdata] => 1 lift ) [2] => Array ( [_attributes] => Array ( [Code] => *RS ) [_cdata] => Room Service from 18:00 to 21:00 ) ) ) ) )
统计信息
- 总下载量: 98
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-06-05