simplexml_load_string()
で何が起こっているのかを判断するのに問題があります。以下のコードを使用してXMLをレンダリングしています。このコードを実行すると、
Message: simplexml_load_string() [function.simplexml-load-string]: Entity: line 94: parser error : Opening and ending tag mismatch: meta line 15 and head
どのように私はこれらの警告をキャッチすることができますか? libxml_get_errors
は効果がありません。
$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
}