How do I parse XML from PHP that was sent to the server as text/xml?

前端 未结 1 1277
無奈伤痛
無奈伤痛 2021-01-07 08:45

I have a client-side script written in jQuery that is sending text/xml data to the server, but I can\'t figure out how to parse the request since the data is not a query str

相关标签:
1条回答
  • 2021-01-07 09:10

    I think you want something like:

    $xml_text = file_get_contents("php://input");
    $xml = simplexml_load_string($xml_text);
    
    0 讨论(0)
提交回复
热议问题