eleme/easyxml

PHP xml library

Installs: 29

Dependents: 0

Suggesters: 0

Security: 0

Stars: 17

Watchers: 15

Forks: 0

pkg:composer/eleme/easyxml

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

This package is not auto-updated.

Last update: 2025-10-07 07:13:46 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";