承接 alextartan/xml2array 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

alextartan/xml2array

最新稳定版本:2.0.2

Composer 安装命令:

composer require alextartan/xml2array

包简介

Lightweight xml<->array conversion.

README 文档

README

Array <-> XML conversion package

Lightweight XML parser

Current build status

Build Status codecov Infection MSI Dependabot Status Downloads

Install

The easiest way is to use composer:

composer require alextartan/xml2array 

Notes:

Latest release requires PHP >= 7.2 and the dom extension (ext-dom)

For PHP <= 7.2, use version 1.0.2

Usage

ArrayToXml

Convert an XML (either DOMDocument or string) to an array

// default value: $config = [ 'version' => '1.0', 'encoding' => 'UTF-8', 'attributesKey' => '@attributes', 'cdataKey' => '@cdata', 'valueKey' => '@value', 'useNamespaces' => false, 'forceOneElementArray => false, ]; $xtoa = new XmlToArray($config); $array = $xtoa->buildArrayFromString($xmlString); $array = $xtoa->buildArrayFromDomDocument($xmlDom); 
XmlToArray

Convert an array to a DOMDocument

// default value: $config = [ 'version' => '1.0', 'encoding' => 'UTF-8', 'attributesKey' => '@attributes', 'cdataKey' => '@cdata', 'valueKey' => '@value', 'formatOutput' => false, ]; $atox = new ArrayToXml($config); $xml = $atox->buildXml($array); 

Issues and pull requests.

Any issues found should be reported in this repository issue tracker, issues will be fixed when possible. Pull requests will be accepted, but please adhere to the PSR2 coding standard. All builds must pass in order to merge the PR.

统计信息

  • 总下载量: 40.87k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 4
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固