libxml_get_errors Hataları içeren bir dizi döndürür &reftitle.description; arraylibxml_get_errors Hataları içeren bir dizi döndürür. &reftitle.parameters; &no.function.parameters; &reftitle.returnvalues; Tamponda bir hata oluşmuşsa LibXMLError nesnelerinden oluşan bir dizi, yoksa boş bir dizi döner. &reftitle.examples; - <function>libxml_get_errors</function> örneği Örnekte basit bir libxml hata eylemcisinin gerçeklenişi gösterilmiştir. PHP: Behind the Parser XML; $doc = simplexml_load_string($xmlstr); $xml = explode("\n", $xmlstr); if ($doc === false) { $errors = libxml_get_errors(); foreach ($errors as $error) { echo display_xml_error($error, $xml); } libxml_clear_errors(); } function display_xml_error($error, $xml) { $return = $xml[$error->line - 1] . "\n"; $return .= str_repeat('-', $error->column) . "^\n"; switch ($error->level) { case LIBXML_ERR_WARNING: $return .= "Uyarı $error->code: "; break; case LIBXML_ERR_ERROR: $return .= "Hata $error->code: "; break; case LIBXML_ERR_FATAL: $return .= "Ölümcül hata $error->code: "; break; } $return .= trim($error->message) . "\n Satır: $error->line" . "\n Sütun: $error->column"; if ($error->file) { $return .= "\n Dosya: $error->file"; } return "$return\n\n--------------------------------------------\n\n"; } ?> ]]> &example.outputs; PHP: Behind the Parser ----------------------------------------------^ Ölümcül hata 76: Opening and ending tag mismatch: titles line 4 and title Satır: 4 Sütun: 46 -------------------------------------------- ]]> &reftitle.seealso; libxml_get_last_error libxml_clear_errors