https://github.com/eleme/easyxml
php xml lib
https://github.com/eleme/easyxml
Last synced: 7 months ago
JSON representation
php xml lib
- Host: GitHub
- URL: https://github.com/eleme/easyxml
- Owner: eleme
- Created: 2014-08-08T01:11:19.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-11-20T09:01:37.000Z (about 11 years ago)
- Last Synced: 2025-05-03T16:17:47.924Z (8 months ago)
- Language: PHP
- Homepage: http://eleme.github.io/easyxml
- Size: 227 KB
- Stars: 17
- Watchers: 16
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Easyxml
[](https://travis-ci.org/thbourlove/easyxml)
[](https://scrutinizer-ci.com/g/thbourlove/easyxml/)
[](https://scrutinizer-ci.com/g/thbourlove/easyxml/?branch=master)
[](https://packagist.org/packages/eleme/easyxml)
php xml lib.
## Install With Composer:
```json
"require": {
"eleme/easyxml": "~0.3"
}
```
## Example
#### array_2_xml(array $array, $structure = '')
```php
$array = array('abc' => array('cba' => 'abc', 'abc' => ''));
echo array_2_xml($array), "\n";
$structure = '';
echo array_2_xml($array, $structure), "\n";
```
#### json_2_xml($json, $structure = '')
```php
$json = '{"abc":{"cba":"abc","abc":""}}';
echo json_2_xml($json), "\n";
$structure = '';
echo json_2_xml($json, $structure), "\n";
```
#### xml_2_array($xml)
```php
$xml = 'abc';
echo var_export(xml_2_array($xml)), "\n";
```
#### xml_2_json($xml)
```php
$xml = 'abc';
echo xml_2_json($xml), "\n";
```