PHP libxml_get_errors() Function

The libxml_get_errors() function gets errors from the the libxml error buffer This function returns an array of error objects, and an empty array if there are no errors in the libxml error buffer.

array libxml_get_errors ( void )

Retrieve array of errors.

Example -

This example demonstrates how to build a simple libxml error handler.

The above example will output : -

  <titles>PHP: Behind the Parser</title>
----------------------------------------------^
Fatal Error 76: Opening and ending tag mismatch: titles line 4 and title
  Line: 4
  Column: 46

--------------------------------------------

Returns an array with LibXMLError objects if there are any errors in the buffer, or an empty array otherwise.