saveDomDocument

Definition:
function saveDomDocument($doc, $filename) {}

Saves the XML document into a file

Parameters

  • DOMDocument $doc
  • string $filename

Source code

function saveDomDocument($doc, $filename) {

	$config = $doc->saveXML();

	$config = preg_replace("/([^\r])\n/", "$1\r\n", $config);

	$fp = fopen($filename, 'w');

	fwrite($fp, $config);

	fclose($fp);

}

2803

No comments yet... Be the first to leave a reply!

Leave a comment