2017 © Pedro Peláez
 

library from-xml-to-array

Conversion from xml to array

image

alyjee/from-xml-to-array

Conversion from xml to array

  • Saturday, June 9, 2018
  • by alyjee
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Conversion from xml to an array

A package inspired by vyuldashev/xml-to-array to convert an xml to array, (*1)

Inspired by Vyuldashev's xml-to-array ❤️, (*2)

Install

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

``` bash composer require alyjee/from-xml-to-array, (*4)


## Usage ```php use Alyjee\XmlToArray\XmlToArray; $xml = '<items><Facilities><Facility Code="*EC"></Facility><Facility Code="*LF"></Facility><Facility Code="*RS"></Facility></Facilities></items>'; $result = XmlToArray::convert($xml);

After running this piece of code $result will contain:, (*5)

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
                                )

                        )

                )

        )

)

The Versions

09/06 2018

dev-master

9999999-dev

Conversion from xml to array

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

by Tahir Raza

05/06 2018

1.0

1.0.0.0

Conversion from xml to array

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

by Tahir Raza