2017 © Pedro Peláez
 

library xml-converter

A PHP XML parser and compiler that provides an easy way to convert XML into native PHP arrays and back again. No dependencies on external libraries or extensions.

image

greencape/xml-converter

A PHP XML parser and compiler that provides an easy way to convert XML into native PHP arrays and back again. No dependencies on external libraries or extensions.

  • Thursday, July 2, 2015
  • by GreenCape
  • Repository
  • 1 Watchers
  • 6 Stars
  • 15,693 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 5 % Grown

The README.md

PHP XML Converter

SensioLabsInsight Code Climate Test Coverage Latest Stable Version Build Status, (*1)

A PHP XML parser class that provides an easy way to convert XML into native PHP arrays and back again. It has no dependencies on any external libraries or extensions bundled with PHP. The entire parser is concisely written in PHP., (*2)

This project is actively maintained. It is used in our production code. If you spot an issue, please let us know through the Issues section on our Github project page: https://github.com/greencape/xml-converter/issues, (*3)

In short, this project makes sense for those who want to simplify their PHP install and use, have a need for a simple XML parser, but don't much care about speed., (*4)

Requirements

PHP 7.2+, (*5)

Installation

Composer

Simply add a dependency on greencape/xml-converter to your project's composer.json file if you use Composer to manage the dependencies of your project. Here is a minimal example of a composer.json file that just defines a dependency on XML Converter:, (*6)

{
    "require": {
        "greencape/xml-converter": "*@dev"
    }
}

For a system-wide installation via Composer, you can run:, (*7)

$ composer global require 'greencape/xml-converter=*'

Make sure you have ~/.composer/vendor/bin/ in your path., (*8)

Usage Examples

XML String to PHP Array


<breakfast_menu>
    <food>
        <name>Waffles</name>
    </food>
</breakfast_menu>');
var_dump($xml->data);

XML File to PHP Array

<?php
$xml = new \GreenCape\Xml\Converter('some_xml_file.xml');
var_dump($xml->data);

PHP Array to XML String

<?php
$xml = new \GreenCape\Xml\Converter(array(
    'breakfast_menu' => array(
        array(
            'food' => array(
                'name' => 'Waffles'
            )
        )
    )
));
echo $xml;

The Versions

02/07 2015

dev-master

9999999-dev https://github.com/GreenCape/xml-converter

A PHP XML parser and compiler that provides an easy way to convert XML into native PHP arrays and back again. No dependencies on external libraries or extensions.

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

by Niels Braczek
by Marat A. Denenberg

06/08 2014

v1.1.0

1.1.0.0 https://github.com/greencape/xml-converter

A PHP XML parser and compiler that provides an easy way to convert XML into native PHP arrays and back again. No dependencies on external libraries or extensions.

  Sources   Download

GPL 2.0+

The Requires

  • php >=5.4

 

The Development Requires

by Niels Braczek
by Marat A. Denenberg

03/08 2014

v1.0.0

1.0.0.0 https://github.com/greencape/xml-converter

A PHP XML parser and compiler that provides an easy way to convert XML into native PHP arrays and back again. No dependencies on external libraries or extensions.

  Sources   Download

GPL 2.0+

The Requires

  • php >=5.4

 

The Development Requires

by Niels Braczek
by Marat A. Denenberg