liukaida 发表于 2017-3-30 09:59:21

php 检测domain信息

  可以获得任一网站的信息

<?
function WhoIs($DomainName)
{
// Open a socket to geektools.com, one of the whois servers
$Socket = fsockopen("www.geektools.com", 43, $ErrorNum, $ErrorStr) or die("$errno: $errstr");
fputs($Socket, $DomainName."\n");
// Receive data from the whois server and put into a string
while(!feof($Socket))
{
$WhoIsString .= fgets($Socket, 2048);
}
// Close the stream and return the string
fclose($Socket);
return $WhoIsString;
}
// Sample use of the WhoIs service
echo "Who Is Geekpedia.com?<br />";
echo "<pre>".WhoIs("baidu.com")."</pre>";
?>
 
页: [1]
查看完整版本: php 检测domain信息