PHPackages                             plustime-it/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. plustime-it/xml-to-array

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

plustime-it/xml-to-array
========================

Easily convert valid xml to a php array.

1.0.0(3y ago)09.5kMITPHPPHP ^8.0

Since Mar 26Pushed 3y agoCompare

[ Source](https://github.com/PlusTimeIT/xml-to-array)[ Packagist](https://packagist.org/packages/plustime-it/xml-to-array)[ RSS](/packages/plustime-it-xml-to-array/feed)WikiDiscussions master Synced today

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

Easily convert valid xml to a php array.

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

[](#installation)

Install via composer:

```
composer require plustime-it/xml-to-array

```

Quick start
-----------

[](#quick-start)

### Using the class

[](#using-the-class)

```
use PlusTimeIT\XmlToArray\XmlToArray;

$xml =  'fedex',
	'id' => '123',
	'tracking_number' => '9205590164917312751089'
];
```

### Using the global helper

[](#using-the-global-helper)

```
$xml =  'fedex',
	'id' => '123',
	'tracking_number' => '9205590164917312751089'
];
```

Helpers, methods, and arguments
-------------------------------

[](#helpers-methods-and-arguments)

**Static method**

`XmlToArray::convert($xml, $outputRoot = false)`

The `$outputRoot` determines whether or not the php array will have a `@root` key. Default is `false`.

**Helper**

`xml_to_array($xml, $outputRoot = false)`

Arguments are identical to `XmlToArray::convert` method.

Purpose
-------

[](#purpose)

XML has always been a challenge to work with in PHP compared to other data formats, such as JSON. This package aims to make integrating with XML files or api requests significantly easier. With this package, you might actually like interfacing with XML in your application now.

Credits
-------

[](#credits)

This package was originally created and maintained by Mark Townsend, as at 26/03/2023 there was no Laravel 9 compatibility and this update aims to fix that.

- Mark Townsend
- Adrien aka Gaarf
- PlusTimeIT
- [All Contributors](../../contributors)

Testing
-------

[](#testing)

You can run the tests with:

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

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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

Unknown

Total

1

Last Release

1195d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7cd6a8307d78faf414982ed267088fc2faf9a69c839a8c62ac49beddbd29dc54?d=identicon)[PlusTimeIT](/maintainers/PlusTimeIT)

---

Top Contributors

[![mtownsend5512](https://avatars.githubusercontent.com/u/4945553?v=4)](https://github.com/mtownsend5512 "mtownsend5512 (8 commits)")[![Kane-R-G](https://avatars.githubusercontent.com/u/47911345?v=4)](https://github.com/Kane-R-G "Kane-R-G (3 commits)")[![arthurperton](https://avatars.githubusercontent.com/u/4067531?v=4)](https://github.com/arthurperton "arthurperton (1 commits)")

---

Tags

laravelxmlarrayconvert

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[mtownsend/xml-to-array

Easily convert valid xml to a php array.

1234.0M24](/packages/mtownsend-xml-to-array)[clearstream/xml-to-array

Incredibly simple XML to array PHP converter

6738.4k](/packages/clearstream-xml-to-array)

PHPackages © 2026

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