{"id":15650429,"url":"https://github.com/vyuldashev/xml-to-array","last_synced_at":"2025-05-08T04:40:12.984Z","repository":{"id":37884208,"uuid":"106673178","full_name":"vyuldashev/xml-to-array","owner":"vyuldashev","description":"A simple class to convert an xml to array","archived":false,"fork":false,"pushed_at":"2023-05-03T01:00:28.000Z","size":22,"stargazers_count":36,"open_issues_count":7,"forks_count":16,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-19T04:06:45.819Z","etag":null,"topics":["api","array","php","xml"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vyuldashev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-12T09:33:38.000Z","updated_at":"2024-01-26T09:42:03.000Z","dependencies_parsed_at":"2024-06-18T18:35:57.697Z","dependency_job_id":null,"html_url":"https://github.com/vyuldashev/xml-to-array","commit_stats":{"total_commits":26,"total_committers":4,"mean_commits":6.5,"dds":"0.46153846153846156","last_synced_commit":"28542261014674a3e9615da335dba43c9dcf304b"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vyuldashev%2Fxml-to-array","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vyuldashev%2Fxml-to-array/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vyuldashev%2Fxml-to-array/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vyuldashev%2Fxml-to-array/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vyuldashev","download_url":"https://codeload.github.com/vyuldashev/xml-to-array/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231474812,"owners_count":18382160,"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":["api","array","php","xml"],"created_at":"2024-10-03T12:34:36.323Z","updated_at":"2024-12-27T11:14:19.330Z","avatar_url":"https://github.com/vyuldashev.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Convert xml to an array\n\n[![Latest Stable Version](https://poser.pugx.org/vyuldashev/xml-to-array/v/stable?format=flat-square)](https://packagist.org/packages/vyuldashev/xml-to-array)\n[![Build Status](https://github.com/vyuldashev/xml-to-array/workflows/Tests/badge.svg)](https://github.com/vyuldashev/xml-to-array/actions)\n[![Total Downloads](https://poser.pugx.org/vyuldashev/xml-to-array/downloads?format=flat-square)](https://packagist.org/packages/vyuldashev/xml-to-array)\n[![StyleCI](https://styleci.io/repos/106673178/shield)](https://styleci.io/repos/106673178)\n[![License](https://poser.pugx.org/vyuldashev/xml-to-array/license?format=flat-square)](https://packagist.org/packages/vyuldashev/xml-to-array)\n\nThis package provides a very simple class to convert an xml string to an array.\n\nInspired by Spatie's [array-to-xml](https://github.com/spatie/array-to-xml) ❤️ \n\n## Install\n\nYou can install this package via composer.\n\n``` bash\ncomposer require vyuldashev/xml-to-array\n```\n\n## Usage\n\n```php\nuse Vyuldashev\\XmlToArray\\XmlToArray;\n\n$xml = '\u003citems\u003e\n    \u003cgood_guy\u003e\n        \u003cname\u003eLuke Skywalker\u003c/name\u003e\n        \u003cweapon\u003eLightsaber\u003c/weapon\u003e\n    \u003c/good_guy\u003e\n    \u003cbad_guy\u003e\n        \u003cname\u003eSauron\u003c/name\u003e\n        \u003cweapon\u003eEvil Eye\u003c/weapon\u003e\n    \u003c/bad_guy\u003e\n\u003c/items\u003e';\n\n$result = XmlToArray::convert($xml);\n```\nAfter running this piece of code `$result` will contain:\n\n```php\narray:1 [\n  \"items\" =\u003e array:2 [\n    \"good_guy\" =\u003e array:2 [\n      \"name\" =\u003e \"Luke Skywalker\"\n      \"weapon\" =\u003e \"Lightsaber\"\n    ]\n    \"bad_guy\" =\u003e array:2 [\n      \"name\" =\u003e \"Sauron\"\n      \"weapon\" =\u003e \"Evil Eye\"\n    ]\n  ]\n]\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvyuldashev%2Fxml-to-array","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvyuldashev%2Fxml-to-array","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvyuldashev%2Fxml-to-array/lists"}