{"id":18412172,"url":"https://github.com/midnite81/xml2array","last_synced_at":"2025-04-07T11:31:52.498Z","repository":{"id":46529068,"uuid":"140325695","full_name":"midnite81/xml2array","owner":"midnite81","description":"A package to convert XML to an Array with the inbuilt ability to convert to Json, Laravel Collection and Serialize","archived":false,"fork":false,"pushed_at":"2022-07-19T02:59:01.000Z","size":38,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-22T17:03:22.372Z","etag":null,"topics":["array","php","xml","xml-parser"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/midnite81.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-09T18:20:23.000Z","updated_at":"2023-11-16T16:21:10.000Z","dependencies_parsed_at":"2022-07-19T22:33:58.228Z","dependency_job_id":null,"html_url":"https://github.com/midnite81/xml2array","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/midnite81%2Fxml2array","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/midnite81%2Fxml2array/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/midnite81%2Fxml2array/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/midnite81%2Fxml2array/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/midnite81","download_url":"https://codeload.github.com/midnite81/xml2array/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247644257,"owners_count":20972253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["array","php","xml","xml-parser"],"created_at":"2024-11-06T03:40:05.280Z","updated_at":"2025-04-07T11:31:51.720Z","avatar_url":"https://github.com/midnite81.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Xml2Array \n[![Latest Stable Version](https://poser.pugx.org/midnite81/xml2array/version)](https://packagist.org/packages/midnite81/xml2array) [![Total Downloads](https://poser.pugx.org/midnite81/xml2array/downloads)](https://packagist.org/packages/midnite81/xml2array) [![Latest Unstable Version](https://poser.pugx.org/midnite81/xml2array/v/unstable)](https://packagist.org/packages/midnite81/xml2array) [![License](https://poser.pugx.org/midnite81/xml2array/license.svg)](https://packagist.org/packages/midnite81/xml2array) [![Build](https://travis-ci.org/midnite81/xml2array.svg?branch=master)](https://travis-ci.org/midnite81/xml2array) [![Coverage Status](https://coveralls.io/repos/github/midnite81/xml2array/badge.svg?branch=master)](https://coveralls.io/github/midnite81/xml2array?branch=master)   \n_Package based on [gaarf/XML-string-to-PHP-array](https://github.com/gaarf/XML-string-to-PHP-array)_\n\n## Installation\n\nTo install through composer include the package in your `composer.json`.\n\n_If you are using php 8.1+ use \"^2.0.0\" for php7 use \"^1.0.0\"._\n\n    \"midnite81/xml2array\": \"^2.0.0\"\n\nRun `composer install` or `composer update` to download the dependencies, or \nyou can run `composer require midnite81/xml2array`.\n\n## Example usage:\n \n```php\nuse Midnite81\\Xml2Array\\Xml2Array;\n\n$xml = Xml2Array::create($someXmlString);\n// or $xml = (new Xml2Array())-\u003econvert($someXmlString);\n \n```\n\nIf the string is invalid then an `IncorrectFormatException` will be thrown, \notherwise an `XmlResponse` class will be returned.\n\nYou can access the `XmlResponse` class like an array, as such:\n\n`echo $xml['result'];`\n\nOther methods include: \n\n| Method                  | Description                     |\n|-------------------------|---------------------------------|\n| `$xml-\u003etoArray();`      | Returns the array               |\n| `$xml-\u003etoJson();`       | Returns as JSON                 | \n| `$xml-\u003etoCollection()`  | Returns as Laravel Collection*  |\n| `$xml-\u003eserialize()`     | Returns the array serialized    |\n| `$xml-\u003eserialise()`     | Alias of above                  |\n\n* It will throw an exception if you try to run `$xml-\u003etoCollection()` but \nyou do not have the `collect` helper available.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmidnite81%2Fxml2array","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmidnite81%2Fxml2array","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmidnite81%2Fxml2array/lists"}