How to convert array to SimpleXML

前端 未结 30 3173
遇见更好的自我
遇见更好的自我 2020-11-21 06:52

How can I convert an array to a SimpleXML object in PHP?

30条回答
  •  庸人自扰
    2020-11-21 07:23

    other solution:

    $marray=array(....);
    $options = array(
                    "encoding" => "UTF-8",
                    "output_type" => "xml", 
                    "version" => "simple",
                    "escaping" => array("non-ascii, on-print, markup")
                    );
    $xmlres = xmlrpc_encode_request('root', $marray, $options);
    print($xmlres);
    

提交回复
热议问题