2017 © Pedro Peláez
 

library xml-to-array

Convert xml to an array

image

vyuldashev/xml-to-array

Convert xml to an array

  • Sunday, April 22, 2018
  • by vyuldashev
  • Repository
  • 1 Watchers
  • 6 Stars
  • 5,086 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 1 Open issues
  • 2 Versions
  • 263 % Grown

The README.md

Convert xml to an array

Latest Stable Version Build Status Total Downloads StyleCI License, (*1)

This package provides a very simple class to convert an xml string to an array., (*2)

Inspired by Spatie's array-to-xml ❤️, (*3)

Install

You can install this package via composer., (*4)

``` bash composer require vyuldashev/xml-to-array, (*5)


## Usage ```php 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:, (*6)

array:1 [
  "items" => array:2 [
    "good_guy" => array:2 [
      "name" => "Luke Skywalker"
      "weapon" => "Lightsaber"
    ]
    "bad_guy" => array:2 [
      "name" => "Sauron"
      "weapon" => "Evil Eye"
    ]
  ]
]

The Versions

22/04 2018

dev-master

9999999-dev

Convert xml to an array

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

by Vladimir Yuldashev

12/10 2017

v1.0.0

1.0.0.0

Convert xml to an array

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

by Vladimir Yuldashev