PHPackages                             pixweber/xmlfiletoarray - 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. pixweber/xmlfiletoarray

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

pixweber/xmlfiletoarray
=======================

A very simple function to load your XML file and convert it into PHP array. Easy and effective.

01PHP

Since Apr 11Pushed 7y agoCompare

[ Source](https://github.com/pixweber/simple_php_xml_to_array)[ Packagist](https://packagist.org/packages/pixweber/xmlfiletoarray)[ RSS](/packages/pixweber-xmlfiletoarray/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

\#Load XML file to PHP array

A very simple function to load your XML file and convert it into PHP array. Easy and effective.

Usage
-----

[](#usage)

#### Load your xml file

[](#load-your-xml-file)

```
$array = load_xml_file_to_array('data/food-menu.xml');
```

```

    Belgian Waffles
    $5.95
    Two of our famous Belgian Waffles with plenty of real maple syrup
    650

    Strawberry Belgian Waffles
    $7.95
    Light Belgian waffles covered with strawberries and whipped cream
    900

    Berry-Berry Belgian Waffles
    $8.95
    Light Belgian waffles covered with an assortment of fresh berries and whipped cream
    900

    French Toast
    $4.50
    Thick slices made from our homemade sourdough bread
    600

    Homestyle Breakfast
    $6.95
    Two eggs, bacon or sausage, toast, and our ever-popular hash browns
    950

```

#### And get your result

[](#and-get-your-result)

```
array (size=1)
  'food' =>
    array (size=5)
      0 =>
        array (size=4)
          'name' => string 'Belgian Waffles' (length=15)
          'price' => string '$5.95' (length=5)
          'description' => string 'Two of our famous Belgian Waffles with plenty of real maple syrup' (length=65)
          'calories' => string '650' (length=3)
      1 =>
        array (size=4)
          'name' => string 'Strawberry Belgian Waffles' (length=26)
          'price' => string '$7.95' (length=5)
          'description' => string 'Light Belgian waffles covered with strawberries and whipped cream' (length=65)
          'calories' => string '900' (length=3)
      2 =>
        array (size=4)
          'name' => string 'Berry-Berry Belgian Waffles' (length=27)
          'price' => string '$8.95' (length=5)
          'description' => string 'Light Belgian waffles covered with an assortment of fresh berries and whipped cream' (length=83)
          'calories' => string '900' (length=3)
      3 =>
        array (size=4)
          'name' => string 'French Toast' (length=12)
          'price' => string '$4.50' (length=5)
          'description' => string 'Thick slices made from our homemade sourdough bread' (length=51)
          'calories' => string '600' (length=3)
      4 =>
        array (size=4)
          'name' => string 'Homestyle Breakfast' (length=19)
          'price' => string '$6.95' (length=5)
          'description' => string 'Two eggs, bacon or sausage, toast, and our ever-popular hash browns' (length=67)
          'calories' => string '950' (length=3)
```

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/92b573c9dc40770de53cfa8abd0ba5d723bf96e0a7958cce000e04aa84677b63?d=identicon)[pixweber](/maintainers/pixweber)

### Embed Badge

![Health badge](/badges/pixweber-xmlfiletoarray/health.svg)

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

###  Alternatives

[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[opis/closure

A library that can be used to serialize closures (anonymous functions) and arbitrary data.

2.6k230.0M284](/packages/opis-closure)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)[michelf/php-markdown

PHP Markdown

3.5k52.4M345](/packages/michelf-php-markdown)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)

PHPackages © 2026

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