{"id":22621520,"url":"https://github.com/multidimension-al/xml-array","last_synced_at":"2026-04-27T18:32:24.385Z","repository":{"id":57021875,"uuid":"81175554","full_name":"multidimension-al/xml-array","owner":"multidimension-al","description":"Creates a PHP array from an XML input and converts attributes.","archived":false,"fork":false,"pushed_at":"2019-02-20T01:33:30.000Z","size":20,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-20T17:54:20.240Z","etag":null,"topics":["array","php","xml"],"latest_commit_sha":null,"homepage":"","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/multidimension-al.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}},"created_at":"2017-02-07T06:40:35.000Z","updated_at":"2024-04-25T09:05:03.000Z","dependencies_parsed_at":"2022-08-23T12:20:39.452Z","dependency_job_id":null,"html_url":"https://github.com/multidimension-al/xml-array","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/multidimension-al/xml-array","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multidimension-al%2Fxml-array","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multidimension-al%2Fxml-array/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multidimension-al%2Fxml-array/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multidimension-al%2Fxml-array/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/multidimension-al","download_url":"https://codeload.github.com/multidimension-al/xml-array/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multidimension-al%2Fxml-array/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32349481,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T17:12:42.749Z","status":"ssl_error","status_checked_at":"2026-04-27T17:12:41.658Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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"],"created_at":"2024-12-08T23:10:14.049Z","updated_at":"2026-04-27T18:32:24.365Z","avatar_url":"https://github.com/multidimension-al.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# XML to PHP Array Converter\n\n[![Build Status](https://travis-ci.org/multidimension-al/xml-array.svg)](https://travis-ci.org/multidimension-al/xml-array)\n[![Latest Stable Version](https://poser.pugx.org/multidimensional/xml-array/v/stable.svg)](https://packagist.org/packages/multidimensional/xml-array)\n[![Code Coverage](https://scrutinizer-ci.com/g/multidimension-al/xml-array/badges/coverage.png)](https://scrutinizer-ci.com/g/multidimension-al/xml-array/)\n[![Minimum PHP Version](http://img.shields.io/badge/php-%3E%3D%205.5-8892BF.svg)](https://php.net/)\n[![License](https://poser.pugx.org/multidimensional/xml-array/license.svg)](https://packagist.org/packages/multidimensional/xml-array)\n[![Total Downloads](https://poser.pugx.org/multidimensional/xml-array/d/total.svg)](https://packagist.org/packages/multidimensional/xml-array)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/multidimension-al/xml-array/badges/quality-score.png)](https://scrutinizer-ci.com/g/multidimension-al/xml-array/)\n\nThis is a very simple and basic library that will create a PHP Array from a well formatted XML input. This library does the opposite of our [DOM-Array](https://github.com/multidimension-al/dom-array) library which converts an array into an XML file.\n\n## Requirements\n\n* PHP 5.5+\n\n# Installation\n\nThe easiest way to install this library is to use composer. To install, simply include the following in your ```composer.json``` file:\n\n```\n\"require\": {\n    \"multidimensional/xml-array\": \"*\"\n}\n```\n\nOr run the following command from a terminal or shell:\n\n```\ncomposer require --prefer-dist multidimensional/xml-array\n```\n\nYou can also specify version constraints, with more information available [here](https://getcomposer.org/doc/articles/versions.md).\n\n# Usage\n\nThis library utilizes PSR-4 autoloading, so make sure you include the library near the top of your class file:\n\n```php\nuse Multidimensional\\XmlArray\\XMLArray;\n```\n\nHow to use in your code:\n\n```php\n$xml = '\u003ctag\u003eValue\u003c/tag\u003e';\n$array = XMLArray::generateArray($xml);\nprint_r($array);\n\n//$array = array(\"tag\" =\u003e array(0 =\u003e 'Value'));\n```\n\nBy default, the library will convert attributes and will prepend ```@``` prior to the name of the attribute. You can disable the conversion of attributes by setting the 2nd parameter in ```generateArray``` to false.\n\nWhen set to false, the attributes will be placed in an array, typically marked by the value '@attributes'. \n\n_Null_ or _Empty_ XML will return a null array.\n\n# Contributing\n\nWe appreciate all help in improving this library by either adding functions or improving existing functionality. If you do want to add to our library, please ensure you use PSR-2 formatting and add unit testing for all added functions.\n\nFeel free to fork and submit a pull request!\n\n# License\n\n    MIT License\n    \n    Copyright (c) 2017 - 2019 multidimension.al\n    \n    Permission is hereby granted, free of charge, to any person obtaining a copy\n    of this software and associated documentation files (the \"Software\"), to deal\n    in the Software without restriction, including without limitation the rights\n    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n    copies of the Software, and to permit persons to whom the Software is\n    furnished to do so, subject to the following conditions:\n    \n    The above copyright notice and this permission notice shall be included in all\n    copies or substantial portions of the Software.\n    \n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n    SOFTWARE.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultidimension-al%2Fxml-array","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmultidimension-al%2Fxml-array","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultidimension-al%2Fxml-array/lists"}