PHPackages                             nkrumahthis/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. nkrumahthis/xml-to-array

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

nkrumahthis/xml-to-array
========================

Parses an XML string into an array

v0.1.0-alpha(2y ago)00MITPHP

Since Feb 22Pushed 2y ago1 watchersCompare

[ Source](https://github.com/nkrumahthis/xml-to-array)[ Packagist](https://packagist.org/packages/nkrumahthis/xml-to-array)[ RSS](/packages/nkrumahthis-xml-to-array/feed)WikiDiscussions main Synced yesterday

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

XML to Array Parser
===================

[](#xml-to-array-parser)

A simple PHP library for parsing XML strings into associative arrays.

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

[](#installation)

You can install this package via Composer:

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

Usage
-----

[](#usage)

```
use Nkrumahthis\XMLToArray\XMLToArray;

$xmlString = '

        John Doe
        30
        New York
    ';

$array = XMLToArray::parse($xmlString);

print_r($array);
```

This will output

```
Array
(
    [root] => Array
        (
            [name] => John Doe
            [age] => 30
            [city] => New York
        )
)
```

Testing
-------

[](#testing)

To run PHPUnit tests, use:

```
vendor/bin/phpunit .
```

Contributing
------------

[](#contributing)

Contributions are welcome! Feel free to submit pull requests or open issues on GitHub: nkrumahthis/xml-to-array.

License
-------

[](#license)

This package is licensed under the MIT License. See the LICENSE file for details.

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity29

Early-stage or recently created project

 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

2

Last Release

861d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b2e3cae388850e0303e83c9739f025667361c8cf9d79473fbed325422e67a52b?d=identicon)[nkrumahthis](/maintainers/nkrumahthis)

---

Top Contributors

[![nkrumahthis](https://avatars.githubusercontent.com/u/42615665?v=4)](https://github.com/nkrumahthis "nkrumahthis (12 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[mck89/peast

Peast is PHP library that generates AST for JavaScript code

19139.2M47](/packages/mck89-peast)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9843.5k](/packages/sauladam-shipment-tracker)[jstewmc/rtf

Read and write Rich Text Format (RTF) documents with PHP

45153.1k6](/packages/jstewmc-rtf)[tcds-io/php-jackson

A lightweight, flexible object serializer for PHP, inspired by FasterXML/jackson

113.2k10](/packages/tcds-io-php-jackson)

PHPackages © 2026

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