Created
March 13, 2015 20:38
-
-
Save ubiratanbraga/3a3330fd2900fcb1549d to your computer and use it in GitHub Desktop.
Revisions
-
ubiratanbraga created this gist
Mar 13, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ function fileToDOMDoc($filename) { $dom= new DOMDocument; $xmldata = file_get_contents($filename); $xmldata = str_replace("&", "&", $xmldata); // disguise &s going IN to loadXML() $dom->substituteEntities = true; // collapse &s going OUT to transformToXML() $dom->loadXML($xmldata); return $dom; }