Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP JSON or Array to XML

Tags:

json

arrays

php

xml

Whats the easiest way to take a JSON or Array object and convert it to XML. Maybe I am looking in all the wrong places but I am not finding a decent answer to get me on track with doing it. Is this something I would have to somehow build myself? Or is there something like json_encode/json_decode that will take an array or json object and ust pop it out as a xml object?

like image 418
chris Avatar asked Mar 03 '12 09:03

chris


1 Answers

Check it here: How to convert array to SimpleXML

and this documentation should help you too

Regarding Json to Array, you can use json_decode to do the same!

like image 186
linuxeasy Avatar answered Oct 09 '22 09:10

linuxeasy