PHPackages                             turkevich/php-xml-helper - 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. turkevich/php-xml-helper

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

turkevich/php-xml-helper
========================

PHP XML Helper

061PHP

Since Jun 17Pushed 10y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

PHP XML Helper
==============

[](#php-xml-helper)

##### Static class for encode xml string to array or object &amp; encode array to SimpleXMLElement

[](#static-class-for-encode-xml-string-to-array-or-object--encode-array-to-simplexmlelement)

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

[](#installation)

Installation with Composer

Add in composer.json

```
    "require": {
        ...
        "turkevich/php-xml-helper":"dev-master"
    }

```

Well done!

Example encode
--------------

[](#example-encode)

```
XML::encode(array(
        'book' => array(
            1,
            'page' => 1,
        ),
        'book1' => array(
            'attribute:test' => 2,
            'attribute:test2' => 'testValue',
            'page' => 1,
            'page1' => 'testValue',
        ),
), 'document')->asXML()

```

##### Result:

[](#result)

```

    1
    1

    1
    testValue

```

Example decode
--------------

[](#example-decode)

```
$xml = '

    1
    1

    1
    testValue

';

XML::decode($xml);

or

XML::decode($xml,true);

```

##### Result:

[](#result-1)

```
To array:
array(2) {
  ["book"]=>
  array(3) {
    ["item"]=>
    string(1) "1"
    ["page"]=>
    string(1) "1"
    [0]=>
    string(13) "

  "
  }
  ["book1"]=>
  array(4) {
    ["attribute:"]=>
    array(2) {
      ["test"]=>
      string(1) "2"
      ["test2"]=>
      string(9) "testValue"
    }
    ["page"]=>
    string(1) "1"
    ["page1"]=>
    string(9) "testValue"
    [0]=>
    string(13) "

  "
  }
}

To object:
object(stdClass)#5 (2) {
  ["book"]=>
  array(3) {
    ["item"]=>
    string(1) "1"
    ["page"]=>
    string(1) "1"
    [0]=>
    string(13) "

  "
  }
  ["book1"]=>
  array(4) {
    ["attribute:"]=>
    array(2) {
      ["test"]=>
      string(1) "2"
      ["test2"]=>
      string(9) "testValue"
    }
    ["page"]=>
    string(1) "1"
    ["page1"]=>
    string(9) "testValue"
    [0]=>
    string(13) "

  "
  }
}

```

Enjoy, guys!

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

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/9de505bb0da0911ac544bd2c5e092cb9807c05d58c6cc23268e9e6a26ebbec10?d=identicon)[nemed](/maintainers/nemed)

### Embed Badge

![Health badge](/badges/turkevich-php-xml-helper/health.svg)

```
[![Health](https://phpackages.com/badges/turkevich-php-xml-helper/health.svg)](https://phpackages.com/packages/turkevich-php-xml-helper)
```

###  Alternatives

[lillik/module-seo-pagination

Magento 2 Seo Pagination

1014.2k](/packages/lillik-module-seo-pagination)

PHPackages © 2026

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