News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint.com:
How to Create an XML to JSON Proxy Server in PHP
October 19, 2011 @ 13:07:08

On SitePoint.com today there's a new post from Craig Buckler showing you how to create a simple XML to JSON proxy server in PHP with a SimpleXML object at its heart.

Unless you're new to this web development lark, you'll know the 'X' in 'AJAX' stands for XML - eXtensible Markup Language. But you're probably not using XML. If you are, you'd probably prefer not to. All the cool kids are using JSON or JSON-P: it has a smaller payload, is easier to use and faster to process. [...] Fortunately, there are a couple of solutions which allow you to retain the benefits of XML data interchange but provide the ease of JSON in JavaScript. In this article, we're going to create an XML to JSON proxy server in PHP.

Of course, this will only work with well-formatted XML documents, but it's a quick little hack that pulls in the XML data with a curl request and parses it via SimpleXML and uses json_encode to push it back out as JSON.

0 comments voice your opinion now!
xml translate json proxy server tutorial simplexml


blog comments powered by Disqus

Similar Posts

PHPRiot.com: Zend Framework 101: Zend_Soap

Juozas Kaziukenas' Blog: Scraping login requiring websites with cURL

Jurian Suilman's Blog: Use 3rd party modules in Zend Framework 2

ITNewb.com: PHP Encryption / Decryption Using the MCrypt Library (libmcrypt)

DeveloperTutorials.com: How to Install PHP 5 on Linux


Community Events





Don't see your event here?
Let us know!


language extension configure install unittest voicesoftheelephpant community symfony release opinion podcast interview introduction series conference composer list version laravel api

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework