Casey Casey - 1 year ago 138
PHP Question

Create and Save XML file to Server Using PHP

I'm using PHP to extract data from a MySQL database. I am able to build an XML file using DOM functions. Then using

echo $dom->saveXML();
, I am able to return the XML from an AJAX call. Instead of using AJAX to get the XML, how would I save the XML file to a spot on the server? Thanks

Answer Source

Use the DOMDocument::save() method to save the XML document into a file:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download