Saving returned XML data in PHP to an XML file

I have a php file which requests xml data and displays it it the browser. The XML is displayed by:

$xmlString = constructPostCallAndGetResponse($endpoint, $item, $postCode, $dist);

$resp = simplexml_load_string($xmlString);

echo htmlentities($xmlString);

How do I save the returned XML to an XML file on my server? Ive read alot about DOM but keep going in circles. Can anyone suggest a simple way of doing this?


保存到文件,与你的sinplexml对象只是做...

$resp->asXML('file.xml');
链接地址: http://www.djcxy.com/p/29838.html

上一篇: 使用php代码获取xml文件中的最新节点值

下一篇: 将PHP中返回的XML数据保存为XML文件