XML Document Parser for PHP

v2.0.2 2019-07-24 02:33 UTC


Parser Component is a framework agnostic package that provide a simple way to parse XML to array without having to write a complex logic.

Build Status Latest Stable Version Total Downloads Latest Unstable Version License Coverage Status

Imagine if you can parse

    <user followers="5">


$user = [
    'id' => '1',
    'email' => '',
    'followers' => '5'

by just writing this:

use Laravie\Parser\Xml\Reader;
use Laravie\Parser\Xml\Document;

$xml = (new Reader(new Document()))->load('path/to/above.xml');

$user = $xml->parse([
    'id' => ['uses' => ''],
    'email' => ['uses' => ''],
    'followers' => ['uses' => 'user::followers'],


To install through composer, simply put the following in your composer.json file:

    "require": {
        "laravie/parser": "^2.0"

And then run composer install from the terminal.

Quick Installation

Above installation can also be simplify by using the following command:

composer require "laravie/parser=^2.0"