PHPackages                             openlss/lib-array2xml - 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. openlss/lib-array2xml

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

openlss/lib-array2xml
=====================

Array2XML conversion library credit to lalit.org

1.0.0(7y ago)31052.5M↓10.6%25[2 issues](https://github.com/nullivex/lib-array2xml/issues)[4 PRs](https://github.com/nullivex/lib-array2xml/pulls)20Apache-2.0PHPPHP &gt;=5.3.2

Since Mar 23Pushed 4y ago4 watchersCompare

[ Source](https://github.com/nullivex/lib-array2xml)[ Packagist](https://packagist.org/packages/openlss/lib-array2xml)[ Docs](https://www.nullivex.com)[ RSS](/packages/openlss-lib-array2xml/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)DependenciesVersions (15)Used By (20)

lib-array2xml
=============

[](#lib-array2xml)

Array2XML conversion library credit to lalit.org

Usage
-----

[](#usage)

```
//create XML
$xml = Array2XML::createXML('root_node_name', $php_array);
echo $xml->saveXML();

//create Array
$array = XML2Array::createArray($xml);
print_r($array);
```

Array2XML
---------

[](#array2xml)

@xml example:

```
// Build the array that should be transformed into a XML object.
$array = [
    'title' => 'A title',
    'body' => [
        '@xml' => 'The content for the news item',
    ],
];

// Use the Array2XML object to transform it.
$xml = Array2XML::createXML('news', $array);
echo $xml->saveXML();
```

This will result in the following.

```

  A title

        The content for the news item

```

Reference
---------

[](#reference)

More complete references can be found here

Changelog
---------

[](#changelog)

### 1.0.0

[](#100)

- Add ability for callbacks during processing to check status.

### 0.5.1

[](#051)

- Fix fata error when the array passed is empty fixed by pull request #6

### 0.5.0

[](#050)

- add second parameter to XML2Array::createArray for DOMDocument::load, e.g: LIBXML\_NOCDATA
- change method visibility from private to protected for overloading
- Merge pull request #5 to add child xml
- Merge pull request #4 to change method visibility and add second parameter for load.

### 0.1.0

[](#010)

- Initial Release

###  Health Score

51

—

FairBetter than 96% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity69

Solid adoption and visibility

Community36

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 64.5% 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 ~183 days

Recently: every ~548 days

Total

13

Last Release

2607d ago

Major Versions

0.5.1 → 1.0.02019-03-29

### Community

Maintainers

![](https://www.gravatar.com/avatar/83c8e9d55e3ebafb0621a441a51af8f551f61a274fde5400459a29cc320b7b75?d=identicon)[nullivex](/maintainers/nullivex)

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

---

Top Contributors

[![nullivex](https://avatars.githubusercontent.com/u/2321375?v=4)](https://github.com/nullivex "nullivex (20 commits)")[![h3rj4n](https://avatars.githubusercontent.com/u/738683?v=4)](https://github.com/h3rj4n "h3rj4n (5 commits)")[![godsgood33](https://avatars.githubusercontent.com/u/1922710?v=4)](https://github.com/godsgood33 "godsgood33 (1 commits)")[![averichev](https://avatars.githubusercontent.com/u/5820708?v=4)](https://github.com/averichev "averichev (1 commits)")[![kuangjy2](https://avatars.githubusercontent.com/u/2821471?v=4)](https://github.com/kuangjy2 "kuangjy2 (1 commits)")[![max-kovpak](https://avatars.githubusercontent.com/u/8402366?v=4)](https://github.com/max-kovpak "max-kovpak (1 commits)")[![justplaymore](https://avatars.githubusercontent.com/u/1845780?v=4)](https://github.com/justplaymore "justplaymore (1 commits)")[![doyjo](https://avatars.githubusercontent.com/u/3947855?v=4)](https://github.com/doyjo "doyjo (1 commits)")

---

Tags

xmlarrayxml conversionarray conversion

### Embed Badge

![Health badge](/badges/openlss-lib-array2xml/health.svg)

```
[![Health](https://phpackages.com/badges/openlss-lib-array2xml/health.svg)](https://phpackages.com/packages/openlss-lib-array2xml)
```

###  Alternatives

[digitickets/lalit

GitHub copy of LaLit's XML2Array and Array2XML

721.3M6](/packages/digitickets-lalit)[hiraku/xml_builder

Simple DSL for building XML

141.6k1](/packages/hiraku-xml-builder)

PHPackages © 2026

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