Whois запрос на PHP
// Whois запрос на PHP
function RipeIPInfo2($ip){
$oSocket = fsockopen("whois.tcinet.ru",43,$sErrorNo, $sErrorMsg);
fputs($oSocket,$ip."\r\n");
while(!feof($oSocket)){
$line=trim(fgets($oSocket,128));dbg($line);
if ($line[0]=='%' OR !$line) continue;
$line=explode(':',$line);
$result[$line[0]][]=trim($line[1]);
}
fclose($oSocket);
if ($result) foreach ($result as $key => &$value){
$value= implode(',', array_unique($value));
}
return $result;
}