I’m having some trouble determining what’s going on with simplexml_load_string() I’m using the below code to render some XML…. when I run this code I get error messages like:
Message: simplexml_load_string() [function.simplexml-load-string]: Entity: line 94: parser error : Opening and ending tag mismatch: meta line 15 and head
Any ideas on how I can catch these warnings? libxml_get_errors has no affect.
$response = simplexml_load_string($response);
var_dump($response);
if (count(libxml_get_errors()) > 0) {
print_r(libxml_get_errors());
}
if (is_object($response)) { //returns true when warnings are thrown
//process response
} else {
//record error
}
1 Answer