nkrumahthis/xml-to-array
最新稳定版本:v0.1.0-alpha
Composer 安装命令:
composer require nkrumahthis/xml-to-array
包简介
Parses an XML string into an array
README 文档
README
A simple PHP library for parsing XML strings into associative arrays.
Installation
You can install this package via Composer:
composer require nkrumahthis/xml-to-array
Usage
use Nkrumahthis\XMLToArray\XMLToArray; $xmlString = '<?xml version="1.0" encoding="UTF-8"?> <root> <name>John Doe</name> <age>30</age> <city>New York</city> </root>'; $array = XMLToArray::parse($xmlString); print_r($array);
This will output
Array ( [root] => Array ( [name] => John Doe [age] => 30 [city] => New York ) )
Testing
To run PHPUnit tests, use:
vendor/bin/phpunit .
Contributing
Contributions are welcome! Feel free to submit pull requests or open issues on GitHub: nkrumahthis/xml-to-array.
License
This package is licensed under the MIT License. See the LICENSE file for details.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-02-23