Encoding an object in XML with PHP

Why is it so hard to deal with XML in PHP? Why can’t there be a simple ‘xml_encode()’ and ‘xml_decode()’ like there is with JSON??

I’ve written a very simple XML class to handle very simple XML encoding in PHP:

comments powered by Disqus