$xpath = new DOMXPath($dom);
- $lists = $xpath->query("//code[@class='ip]");
+ $element = $xpath->query("//code[@class='ip']");
+ if(!$element->length){
+ return;
+ }
+
+ $ip = $element->item(0)->nodeValue;
+
+ $cmd = "host {$ip}";
+
+ $e = `$cmd`;
+
+ $helo = substr(array_pop(explode(' ', $e)), 0, -2);
- print_R($lists);exit;
+ print_R($helo);exit;
$error = array();