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?
 

195471

Regular Member
Joined
Oct 11, 2008
Messages
417
Reaction score
264
Check this:

Code:
http://goessner.net/download/prj/jsonxml/
 

paincake

Power Member
Joined
Aug 18, 2010
Messages
719
Reaction score
3,122
JSON is sooo much easier to parse... Just use json_decode() and you'll instantly have all the values as variables...
 
Last edited:

Crazy

Power Member
Joined
Jun 13, 2009
Messages
640
Reaction score
323
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?
 

deziner

Newbie
Joined
Oct 22, 2010
Messages
25
Reaction score
15
json_decode it and then use simplexml to convert it into xml ;)
 
Top