How do I Convert jSON to XML

后端 未结 4 858
离开以前
离开以前 2020-12-31 22:05

Before I begin, I know there are a bunch of questions similar to this, but trust me, I read all, if not most of them. I tried a bunch of solutions, but none of them seem to

4条回答
  •  一整个雨季
    2020-12-31 22:44

    The built in functions can do this.

    $xml = new SimpleXMLElement('');
    $arr = json_decode($your_array, true);
    array_walk_recursive($arr, array ($xml,'addChild'));
    

提交回复
热议问题