vyuldashev/xml-to-array
最新稳定版本:v1.1.0
Composer 安装命令:
composer require vyuldashev/xml-to-array
包简介
Convert xml to an array
README 文档
README
This package provides a very simple class to convert an xml string to an array.
Inspired by Spatie's array-to-xml ❤️
Install
You can install this package via composer.
composer require vyuldashev/xml-to-array
Usage
use Vyuldashev\XmlToArray\XmlToArray; $xml = '<items> <good_guy> <name>Luke Skywalker</name> <weapon>Lightsaber</weapon> </good_guy> <bad_guy> <name>Sauron</name> <weapon>Evil Eye</weapon> </bad_guy> </items>'; $result = XmlToArray::convert($xml);
After running this piece of code $result will contain:
array:1 [ "items" => array:2 [ "good_guy" => array:2 [ "name" => "Luke Skywalker" "weapon" => "Lightsaber" ] "bad_guy" => array:2 [ "name" => "Sauron" "weapon" => "Evil Eye" ] ] ]
统计信息
- 总下载量: 799.89k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 38
- 点击次数: 1
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-10-12