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
Use the DOMDocument::save()
method to save the XML document into a file:
$dom->save('document.xml');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With