eleme/easyxml

PHP xml library

Maintainers

Package info

github.com/thbourlove/easyxml

Issues

pkg:composer/eleme/easyxml

Statistics

Installs: 29

Dependents: 0

Suggesters: 0

Stars: 17

v0.3.0 2014-11-18 10:58 UTC

This package is not auto-updated.

Last update: 2026-03-10 08:59:07 UTC


README

Build Status Scrutinizer Code Quality Code Coverage Stable Status

php xml lib.

Install With Composer:

"require": {
    "eleme/easyxml": "~0.3"
}

Example

array_2_xml(array $array, $structure = '')

$array = array('abc' => array('cba' => 'abc', 'abc' => ''));
echo array_2_xml($array), "\n";
$structure = '<?xml version="1.0" encoding="utf-8"?>';
echo array_2_xml($array, $structure), "\n";

json_2_xml($json, $structure = '')

$json = '{"abc":{"cba":"abc","abc":""}}';
echo json_2_xml($json), "\n";
$structure = '<?xml version="1.0" encoding="utf-8"?>';
echo json_2_xml($json, $structure), "\n";

xml_2_array($xml)

$xml = '<?xml version="1.0"?><abc><cba>abc</cba><abc/></abc>';
echo var_export(xml_2_array($xml)), "\n";

xml_2_json($xml)

$xml = '<?xml version="1.0"?><abc><cba>abc</cba><abc/></abc>';
echo xml_2_json($xml), "\n";