{"id":21128856,"url":"https://github.com/alextartan/xml2array","last_synced_at":"2025-08-09T09:09:41.775Z","repository":{"id":37549016,"uuid":"150724911","full_name":"alextartan/xml2array","owner":"alextartan","description":"Lightweight xml\u003c-\u003earray conversion.","archived":false,"fork":false,"pushed_at":"2023-01-16T03:05:09.000Z","size":301,"stargazers_count":6,"open_issues_count":6,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-09T15:18:52.312Z","etag":null,"topics":["array","php7","xml"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alextartan.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":"2018-09-28T10:35:02.000Z","updated_at":"2022-02-12T13:45:58.000Z","dependencies_parsed_at":"2023-02-10T00:40:13.297Z","dependency_job_id":null,"html_url":"https://github.com/alextartan/xml2array","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextartan%2Fxml2array","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextartan%2Fxml2array/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextartan%2Fxml2array/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextartan%2Fxml2array/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alextartan","download_url":"https://codeload.github.com/alextartan/xml2array/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225470736,"owners_count":17479368,"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","php7","xml"],"created_at":"2024-11-20T05:10:49.827Z","updated_at":"2024-11-20T05:10:50.451Z","avatar_url":"https://github.com/alextartan.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"#### Array \u003c-\u003e XML conversion package\n\nLightweight XML parser\n\nCurrent build status\n===\n\n[![Build Status](https://travis-ci.org/alextartan/xml2array.svg?branch=master)](https://travis-ci.org/alextartan/xml2array)\n[![codecov](https://codecov.io/gh/alextartan/xml2array/branch/master/graph/badge.svg)](https://codecov.io/gh/alextartan/xml2array)\n[![Infection MSI](https://badge.stryker-mutator.io/github.com/alextartan/xml2array/master)](https://stryker-mutator.github.io)\n[![Dependabot Status](https://api.dependabot.com/badges/status?host=github\u0026repo=alextartan/xml2array)](https://dependabot.com)\n[![Downloads](https://img.shields.io/badge/dynamic/json.svg?url=https://repo.packagist.org/packages/alextartan/xml2array.json\u0026label=Downloads\u0026query=$.package.downloads.total\u0026colorB=orange)](https://packagist.org/packages/alextartan/xml2array)\n\nInstall\n===\n\nThe easiest way is to use `composer`:\n\n    composer require alextartan/xml2array\n\nNotes:\n\nLatest release requires `PHP` \u003e= 7.2 and the `dom` extension (`ext-dom`)\n\nFor `PHP` \u003c= 7.2, use version `1.0.2`\n\n\nUsage\n===\n\n###### ArrayToXml\nConvert an XML (either DOMDocument or string) to an array\n\n    // default value:\n    $config =  [\n        'version'             =\u003e '1.0',\n        'encoding'            =\u003e 'UTF-8',\n        'attributesKey'       =\u003e '@attributes',\n        'cdataKey'            =\u003e '@cdata',\n        'valueKey'            =\u003e '@value',\n        'useNamespaces'       =\u003e false,\n        'forceOneElementArray =\u003e false,\n    ];\n\n    $xtoa  = new XmlToArray($config);\n    $array = $xtoa-\u003ebuildArrayFromString($xmlString);\n    $array = $xtoa-\u003ebuildArrayFromDomDocument($xmlDom);\n\n###### XmlToArray\nConvert an array to a DOMDocument\n\n    // default value:\n    $config =  [\n        'version'       =\u003e '1.0',\n        'encoding'      =\u003e 'UTF-8',\n        'attributesKey' =\u003e '@attributes',\n        'cdataKey'      =\u003e '@cdata',\n        'valueKey'      =\u003e '@value',\n        'formatOutput'  =\u003e false,\n    ];\n\n    $atox = new ArrayToXml($config);\n    $xml  = $atox-\u003ebuildXml($array);\n\n\nIssues and pull requests.\n===\n\nAny issues found should be reported in this repository issue tracker, issues will be fixed when possible.\nPull requests will be accepted, but please adhere to the PSR2 coding standard. All builds must pass in order to merge the PR.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falextartan%2Fxml2array","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falextartan%2Fxml2array","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falextartan%2Fxml2array/lists"}