Skip to content

MarcosMenegazzo/badgerfish-php

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BadgerFish-PHP

A PHP Library to transform XML into JSON and JSON into XML following the BadgerFish convention.

Forked from jobywalker/Imperium-BadgerFish in order to remove namespace and a minor improvement to XML exporting.

Usage:

$json = '{ "anode": { "@xmlns": "http://anode.ns", "@id": 1, "child": { "@id": 10, "type": "anodes kid", "value": 123.45 } } }';

header("content-type: text/plain");
echo $json;
echo "\n\n";
echo BadgerFish::jsonToXML($json);

Option(s)

Does not export xml version tag

If you dont need the <?xml> tag starting your output, just do:

$xml = BadgerFish::jsonToXML($json, false);

The second argument controls the ouput of <?xml> tag.

References

About

PHP Library to perform simple BadgerFish transforms

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%