Interchange Helpers

Permalink 2 users found helpful
Are there other helpers similar to the JSON helper (http://www.concrete5.org/documentation/developers/helpers/json ) but for other interchange formats like XML?

ijessup
 
ijessup replied on at Permalink Best Answer Reply 1 Attachment
ijessup
I ran across some xml2array and array2xml classes while surfing around 'teh intarwebs'.

I found 2 specifically that I thought worked very well and were very easy to use. I needed them for a project I'm working on so combined them and rigged them to a helper file... See attached.

My comments say the belong to a package, but they really don't need to be in one. Just drop the contents of the attached zip file in to c5's root folder.

Neither class specified licenses, but I kept their commented attribution.

Usage:
$xml = Loader::helper('xml');
   echo $xml->encode($PHPArray, $rootName, $nodeName);
or
$xml = Loader::helper('xml');
   echo $xml->decode($XMLString);