loadHTMLFile($index)) { $xpath = new DomXPath($dom); $dates = $xpath->query("//div[h2[text()='Calibration Report']]//p[3]/text()"); $date_string = ""; foreach ($dates as $i => $date) { $date_string = $date->nodeValue; $date_string = substr($date_string, 2); } $users = $xpath->query("//div[h2[text()='Calibration Report']]//p[4]/text()"); $user_string = ""; foreach ($users as $i => $user) { $user_string = $user->nodeValue; $user_string = substr($user_string, 2); } $nodes = $xpath->query("//div[h2[text()='Summary']]//td[5]/text()"); foreach ($nodes as $i => $node) { if ($node->nodeValue == "100%") { $result = "Passed"; } else { $result = "Failed"; } echo "