diff --git a/src/hostname.php b/src/hostname.php index 30f4a21..842a416 100644 --- a/src/hostname.php +++ b/src/hostname.php @@ -15,7 +15,8 @@ function gethost($ip) $ires = array(); $host = `host -s -W 5 $ip`; - $host = ($host ? end( explode(' ', trim(trim($host), '.'))) : $ip); + $host = explode(' ', trim(trim($host), '.')); + $host = ($host ? end($host) : $ip); $ires = array(); if(in_array($host, Array('reached', 'record', '3(NXDOMAIN)'))) {