$doc = new DOMDocument();
$doc->loadHTML('url');
$xPath = new DOMXpath($doc);
$xPathQuery = "//text()[contains(translate(.,'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'), '".strtoupper('error message')."')]";
$elements = $xPath->query($xPathQuery);
print " .$element->nodeValue."<br />";