How do I convert JSON to XML?

smooshie

Newbie
Joined
Dec 27, 2009
Messages
18
Reaction score
2
I'm working with an api that only returns json. I know there are ways to parse json with php as well, but i'm much more comfortable with xml. Any ideas how to convert it?
 
Check this:

Code:
http://goessner.net/download/prj/jsonxml/
 
JSON is sooo much easier to parse... Just use json_decode() and you'll instantly have all the values as variables...
 
Last edited:
JSON is sooo much easier to parse... Just use json_decode and you'll instantly have all the values as variables...
This. Why do you feel it necessary to go to XML? What's bothering you w/ JSON?
 
json_decode it and then use simplexml to convert it into xml ;)
 
Back
Top
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features and essential functions on BlackHatWorld and other forums. These functions are unrelated to ads, such as internal links and images. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock