Created
March 13, 2015 20:38
-
-
Save ubiratanbraga/3a3330fd2900fcb1549d 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
| 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; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment