PHPackages                             ermst4r/xml2readablearray - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ermst4r/xml2readablearray

ActivePackage[Utility &amp; Helpers](/categories/utility)

ermst4r/xml2readablearray
=========================

Convert xml to an array string (node1.node2.node3), so you can retrieve them via an multidimensional array by splitting the string.

1.0.3(9y ago)021GPLPHPPHP &gt;=5.3.0

Since Feb 18Pushed 9y ago1 watchersCompare

[ Source](https://github.com/ermst4r/xml2readablearray)[ Packagist](https://packagist.org/packages/ermst4r/xml2readablearray)[ RSS](/packages/ermst4r-xml2readablearray/feed)WikiDiscussions 1.0.3 Synced yesterday

READMEChangelog (4)Dependencies (1)Versions (8)Used By (0)

Parse XML files the easy way :)
===============================

[](#parse-xml-files-the-easy-way-)

Convert xml to an array string and parse the nodes without any effort.

**Real life scenario**

You have an xml file, but you don't want to write a parser for every xml file. What can you do? Install this package :)

**Example**

We want to parse this XML file.

```

    I am
    a
    1337 h4xor

```

**1. Open the xml file**

```
$n = new \Ermst4r\Xml\XmlReaderFacade('feed.xml');
```

**2. Show the mapping for this xml file**

We can now view the xml nodes in string format. If you run this code:

```
print_r($n->showXmlMapping());
```

We see something like this:

```
Array ( [0] => items.node [1] => items.node1 [2] => items.node2 [3] => items.node2.id )
```

**3. Parsing**

Now if we loop through the xml nodes, we can parse the items. Lets say i only want node2 and the id of node2... We simply pass an array of the array node names. See example below.

PS. Remember, we can get the items from the showXmlMapping() method ;-)...

```
while($node = $n->streamingNode()) {

    var_dump($n->XmlArrayToValuesFacade(['items.node2','items.node2.id'],$node));

}
```

And voila we get the value of the xml. (only items which are !is\_array() will be parsed)

Of if you want to parse all the items you can do this:

```
while($node = $n->streamingNode()) {

    var_dump($n->XmlArrayToValuesFacade($n->showXmlMapping(),$node));

}
```

**4. Advanced**

We can even parse complicated xml files with nested nodes and attributes.. The principle stays the same like step 1,2,3.

**Credits**

I hope this package can help you with parsing xml files. This package is also used in my opensource project Dfbuilder is a opensource tool what export files to different formats.

With love...

Erwin Nandpersad

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

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 ~0 days

Total

7

Last Release

3420d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/348199?v=4)[ermisnomore](/maintainers/ermisnomore)[@ermisnomore](https://github.com/ermisnomore)

---

Top Contributors

[![ermst4r](https://avatars.githubusercontent.com/u/1394848?v=4)](https://github.com/ermst4r "ermst4r (31 commits)")

### Embed Badge

![Health badge](/badges/ermst4r-xml2readablearray/health.svg)

```
[![Health](https://phpackages.com/badges/ermst4r-xml2readablearray/health.svg)](https://phpackages.com/packages/ermst4r-xml2readablearray)
```

###  Alternatives

[guava/filament-drafts

A filament plugin that adds the ability to manage drafts and revisions of your models.

7517.0k1](/packages/guava-filament-drafts)

PHPackages © 2026

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