{"id":22621519,"url":"https://github.com/multidimension-al/dom-array","last_synced_at":"2026-01-21T20:38:25.975Z","repository":{"id":57021878,"uuid":"81047817","full_name":"multidimension-al/dom-array","owner":"multidimension-al","description":"Create a DOMDocument from an Array.","archived":false,"fork":false,"pushed_at":"2019-02-21T02:08:04.000Z","size":22,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-11T15:03:10.976Z","etag":null,"topics":["array","domdocument","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/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-06T04:30:15.000Z","updated_at":"2024-05-17T16:45:43.000Z","dependencies_parsed_at":"2022-08-23T13:50:59.642Z","dependency_job_id":null,"html_url":"https://github.com/multidimension-al/dom-array","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/multidimension-al/dom-array","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multidimension-al%2Fdom-array","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multidimension-al%2Fdom-array/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multidimension-al%2Fdom-array/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multidimension-al%2Fdom-array/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/multidimension-al","download_url":"https://codeload.github.com/multidimension-al/dom-array/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multidimension-al%2Fdom-array/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28642220,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T18:04:35.752Z","status":"ssl_error","status_checked_at":"2026-01-21T18:03:55.054Z","response_time":86,"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","domdocument","php","xml"],"created_at":"2024-12-08T23:10:14.048Z","updated_at":"2026-01-21T20:38:20.967Z","avatar_url":"https://github.com/multidimension-al.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Array to DOMDocument Converter\n\n[![Build Status](https://travis-ci.org/multidimension-al/dom-array.svg)](https://travis-ci.org/multidimension-al/dom-array)\n[![Latest Stable Version](https://poser.pugx.org/multidimensional/dom-array/v/stable.svg)](https://packagist.org/packages/multidimensional/dom-array)\n[![Code Coverage](https://scrutinizer-ci.com/g/multidimension-al/dom-array/badges/coverage.png)](https://scrutinizer-ci.com/g/multidimension-al/dom-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/dom-array/license.svg)](https://packagist.org/packages/multidimensional/dom-array)\n[![Total Downloads](https://poser.pugx.org/multidimensional/dom-array/d/total.svg)](https://packagist.org/packages/multidimensional/dom-array)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/multidimension-al/dom-array/badges/quality-score.png)](https://scrutinizer-ci.com/g/multidimension-al/dom-array/)\n\nThis library extends the DOMDocument function by adding a ```loadArray``` function that converts PHP arrays to DOMDocument classes that can be used to generate XML, HTML and other types of code. This library does the opposite of our [XML-Array](https://github.com/multidimension-al/xml-array) library which converts XML to a PHP array.\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/dom-array\": \"*\"\n}\n```\n\nOr run the following command from a terminal or shell:\n\n```\ncomposer require --prefer-dist multidimensional/dom-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\\DomArray\\DOMArray;\n```\n\nHow to use in your code:\n\n```php\n$dom = new DOMArray('1.0', 'utf-8');\n$array = ['item' =\u003e ['subitem' =\u003e 'true', '@id' =\u003e '123']];\n$dom-\u003eloadArray($array);\n$xml = $dom-\u003esaveXML();\n\necho $xml;\n\n/*  \u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n *  \u003citem id=\"123\"\u003e\n *    \u003csubitem\u003etrue\u003c/subitem\u003e\n *  \u003c/item\u003e\n */\n```\n\nAs shown in the example, attributes can be assigned by adding an ```@``` symbol before the attribute name.\n\n_Null_ and _Empty_ arrays will generate a DOMDocument with no elements.\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%2Fdom-array","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmultidimension-al%2Fdom-array","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultidimension-al%2Fdom-array/lists"}