PHPackages                             sharoff/helper-simple-xml - 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. sharoff/helper-simple-xml

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

sharoff/helper-simple-xml
=========================

Класс для преобразования php массива в SimpleXmlElement или в XML структуру

1.0.0(10y ago)0306MITPHPPHP &gt;=5.5.9

Since Dec 25Pushed 10y ago1 watchersCompare

[ Source](https://github.com/Sharoff45/helper-simple-xml)[ Packagist](https://packagist.org/packages/sharoff/helper-simple-xml)[ Docs](https://sharoff.org)[ RSS](/packages/sharoff-helper-simple-xml/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

helper-simple-xml
=================

[](#helper-simple-xml)

Класс для преобразования php массива в SimpleXmlElement или в XML структуру

Пример использования
====================

[](#пример-использования)

Получение объекта SimpleXmlElement
----------------------------------

[](#получение-объекта-simplexmlelement)

```
$data = [
    'request' => [
        '@attributes' => [
            'date' => '25.12.2015',
            'type' => 'get_code'
        ],
    ],
    'phone'   => '+79992223344',
    'code'    => '1234'
];
$xml = HelperSimpleXml::array2xml($data);

```

Получение красивого xml
-----------------------

[](#получение-красивого-xml)

действует по аналогии JSON флага JSON\_PRETTY\_PRINT

```
$data = [
    'request' => [
        '@attributes' => [
            'date' => '25.12.2015',
            'type' => 'get_code'
        ],
    ],
    'phone'   => '+79992223344',
    'code'    => '1234'
];
$xml = HelperSimpleXml::array2BeautyXml($data);

```

В результате получим xml:
-------------------------

[](#в-результате-получим-xml)

```

  +79992223344
  1234

```

Преобразование объекта SimpleXmlElement в красивый xml
------------------------------------------------------

[](#преобразование-объекта-simplexmlelement-в-красивый-xml)

```
$beautyXml = HelperSimpleXml::beautyXml($xml_element);

```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

3833d ago

### Community

Maintainers

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

---

Top Contributors

[![Sharoff45](https://avatars.githubusercontent.com/u/7892544?v=4)](https://github.com/Sharoff45 "Sharoff45 (1 commits)")

### Embed Badge

![Health badge](/badges/sharoff-helper-simple-xml/health.svg)

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

###  Alternatives

[mateusjatenee/shoppingcart

Laravel Shoppingcart

132.3k](/packages/mateusjatenee-shoppingcart)

PHPackages © 2026

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