PHPackages                             vyuldashev/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. [API Development](/categories/api)
4. /
5. vyuldashev/xml-to-array

ActiveLibrary[API Development](/categories/api)

vyuldashev/xml-to-array
=======================

Convert xml to an array

v1.1.0(3y ago)36856.4k↓11.4%15[5 issues](https://github.com/vyuldashev/xml-to-array/issues)[3 PRs](https://github.com/vyuldashev/xml-to-array/pulls)3MITPHPPHP ^7.1|^8.0

Since Oct 12Pushed 3y ago1 watchersCompare

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

READMEChangelogDependencies (3)Versions (5)Used By (3)

Convert xml to an array
=======================

[](#convert-xml-to-an-array)

[![Latest Stable Version](https://camo.githubusercontent.com/b08fa924e58bd5d8c8b35c8d733cf07206a3c2f00d0d283b123278789bc1298c/68747470733a2f2f706f7365722e707567782e6f72672f7679756c6461736865762f786d6c2d746f2d61727261792f762f737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/vyuldashev/xml-to-array)[![Build Status](https://github.com/vyuldashev/xml-to-array/workflows/Tests/badge.svg)](https://github.com/vyuldashev/xml-to-array/actions)[![Total Downloads](https://camo.githubusercontent.com/861619e0304ed6848b03e6680da8ef5a744afafd3d9fa94b850b98d86237f932/68747470733a2f2f706f7365722e707567782e6f72672f7679756c6461736865762f786d6c2d746f2d61727261792f646f776e6c6f6164733f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/vyuldashev/xml-to-array)[![StyleCI](https://camo.githubusercontent.com/b65ac2f7a1f72416cefd7581c04444f7c54a29d4b108466a5d0a166b92d5ea62/68747470733a2f2f7374796c6563692e696f2f7265706f732f3130363637333137382f736869656c64)](https://styleci.io/repos/106673178)[![License](https://camo.githubusercontent.com/369e2cc636b031296a0e171382aa9352c048f7ec79aa5563d887a541712742d9/68747470733a2f2f706f7365722e707567782e6f72672f7679756c6461736865762f786d6c2d746f2d61727261792f6c6963656e73653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/vyuldashev/xml-to-array)

This package provides a very simple class to convert an xml string to an array.

Inspired by Spatie's [array-to-xml](https://github.com/spatie/array-to-xml) ❤️

Install
-------

[](#install)

You can install this package via composer.

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

Usage
-----

[](#usage)

```
use Vyuldashev\XmlToArray\XmlToArray;

$xml = '

        Luke Skywalker
        Lightsaber

        Sauron
        Evil Eye

';

$result = XmlToArray::convert($xml);
```

After running this piece of code `$result` will contain:

```
array:1 [
  "items" => array:2 [
    "good_guy" => array:2 [
      "name" => "Luke Skywalker"
      "weapon" => "Lightsaber"
    ]
    "bad_guy" => array:2 [
      "name" => "Sauron"
      "weapon" => "Evil Eye"
    ]
  ]
]
```

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity51

Moderate usage in the ecosystem

Community19

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 76% 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 ~888 days

Total

3

Last Release

1363d ago

PHP version history (2 changes)v1.0.0PHP &gt;=7.1

v1.1.0PHP ^7.1|^8.0

### Community

Maintainers

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

---

Top Contributors

[![vyuldashev](https://avatars.githubusercontent.com/u/1809081?v=4)](https://github.com/vyuldashev "vyuldashev (19 commits)")[![GarethSomers](https://avatars.githubusercontent.com/u/5942607?v=4)](https://github.com/GarethSomers "GarethSomers (6 commits)")

---

Tags

apiarrayphpxml

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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