I\'m fetching xml files from a server and sometimes I\'m getting a non-valid xml files, because of this I\'m getting a warning:
Warning: DOMDocument::load()
Turn off strict error checking:
$dom = new DOMDocument(); $dom->strictErrorChecking = FALSE ; $dom->load('/path/to/file.xml'); if (!$dom->validate()) { // Invalid XML! }