PHPackages                             ericmorand/xml-to-array - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. ericmorand/xml-to-array

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

ericmorand/xml-to-array
=======================

Simple XML-to-array converter

v1.0.1(7y ago)0295ISCPHP

Since Feb 27Pushed 7y ago1 watchersCompare

[ Source](https://github.com/ericmorand/xml-to-array)[ Packagist](https://packagist.org/packages/ericmorand/xml-to-array)[ RSS](/packages/ericmorand-xml-to-array/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

Plain and simple XML-to-array converter
=======================================

[](#plain-and-simple-xml-to-array-converter)

[![Latest Stable Version](https://camo.githubusercontent.com/e4bb2d86ad92c44d8644c6ab8f08c29ecd59c18abe507bb9c54f45e375003529/68747470733a2f2f706f7365722e707567782e6f72672f657269636d6f72616e642f786d6c2d746f2d61727261792f76657273696f6e)](https://packagist.org/packages/ericmorand/xml-to-array) [![Build Status](https://camo.githubusercontent.com/85baebdab235bfc83f001f1b893239f115b3f7ac74d1623e0ceda114e62aec96/68747470733a2f2f7472617669732d63692e6f72672f657269636d6f72616e642f786d6c2d746f2d61727261792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ericmorand/xml-to-array)

This package provides a very simple converter to convert an XML string to an array. No attributes support, no complex logic, just a plain and simple converter that just works.

Installation
------------

[](#installation)

```
composer require ericmorand/xml-to-array
```

Usage
-----

[](#usage)

```
;

$array = $converter->convertXML($xml);
```

By running this code, `$array` would contain:

```
[
    'prop0' => null,
    'prop1' => 'foo',
    'prop2' => 'foo',
    'prop3' => [
        'prop0' => null,
        'prop1' => 'foo',
        'prop2' => 'foo'
    ]
]
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~4 days

Total

2

Last Release

2629d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/348890b7d82ab8373473c19b58ae1c6bcea8578e057ccd4e69957e71d3e3d875?d=identicon)[ericmorand](/maintainers/ericmorand)

---

Top Contributors

[![ericmorand](https://avatars.githubusercontent.com/u/125664?v=4)](https://github.com/ericmorand "ericmorand (6 commits)")

---

Tags

phpxml

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ericmorand-xml-to-array/health.svg)

```
[![Health](https://phpackages.com/badges/ericmorand-xml-to-array/health.svg)](https://phpackages.com/packages/ericmorand-xml-to-array)
```

###  Alternatives

[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[opis/closure

A library that can be used to serialize closures (anonymous functions) and arbitrary data.

2.6k230.0M284](/packages/opis-closure)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)[michelf/php-markdown

PHP Markdown

3.5k52.4M345](/packages/michelf-php-markdown)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
