Last active
February 19, 2019 09:06
-
-
Save Rekhyt/2f891f265da85b60d425c26611bd9bba to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
$fileIn = @$argv[1] ?: ''; | |
$fileOut = @$argv[2] ?: ''; | |
if (empty($fileIn) || empty($fileOut)) die("No files defined.\n\n"); | |
if (!file_exists($fileIn)) die("File {$fileIn} does not exist.\n\n"); | |
$xml = new SimpleXmlElement(file_get_contents($fileIn)); | |
$dom = dom_import_simplexml($xml)->ownerDocument; | |
$dom->formatOutput = true; | |
file_put_contents($fileOut, $dom->saveXML()); | |
echo "Done.\n\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment