Is there an xml_encode() like json_encode() in PHP?

后端 未结 5 903
天涯浪人
天涯浪人 2020-12-16 11:53

In PHP it is easy to pass back an json objects by using the json_encode().
However is there an XML equivalent of this?

5条回答
  •  攒了一身酷
    2020-12-16 12:09

    You could use xmlrpc_encode.

     xmlrpc_encode ($your_array);
    

    Be careful because this function is EXPERIMENTAL.

    Reference: http://php.net/manual/en/function.xmlrpc-encode.php

提交回复
热议问题