vyuldashev/xml-to-array 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

vyuldashev/xml-to-array

最新稳定版本:v1.1.0

Composer 安装命令:

composer require vyuldashev/xml-to-array

包简介

Convert xml to an array

README 文档

README

Latest Stable Version Build Status Total Downloads StyleCI License

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

GitHub 信息

  • Stars: 36
  • Watchers: 1
  • Forks: 15
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-10-12