I’ve been trying hard on this for a while now, but can’t find a solution on how to convert json to xml in php by file_get_contents. I don’t want to use an online converter but want to have it in my website root directory.
Thanks in advance!
I’ve been trying hard on this for a while now, but can’t find a
Share
You can convert JSON to array/object by using
json_decode(), once you have it inside array you can use any XML Manipulation method to build XML out of it.For example you may build XML structure like this:
By
DOMDocument, and methodDOMDocument::createElement()