The libxml_clear_errors() function lears the libxml error buffer.
Syntax
libxml_clear_errors()
Parameters
NA
Return
The libxml_clear_errors() function returns
Example
The following is an example −
<?php
var_dump(libxml_use_internal_errors(true));
$mydoc = new DOMDocument;
if (!$mydoc->load('new.xml')) {
foreach (libxml_get_errors() as $error) {
// handle the errors now
}
libxml_clear_errors();
}
?>