PHP IPwhois类,PHP IPwhois类
【 tulaoshi.com - PHP 】
原来写的IPwhois类
(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/php/) <?php
/*
*
* Class : IP Whois Verson 1.0
* Info : Get IP's information form 4 whois server
* Author : PhpUp Studio
* Date : 12/12/2004
* www.knowsky.com
*
*/
class IPWhois
{
var $server = 'whois.arin.net';
var $target;
var $timeout = 10;
var $msg;
function IPWhois($target)
{
$this-target = $target;
}
function ShowInfo()
{
if($this-_CheckIP($this-target))
{
$this-msg = $this-_GetInfo($this-server);
if($this-_CheckInfo($this-msg))
{
$this-msg = $this-_GetInfo($this-server);
}
}
else $this-msg = '<pPlease Enter An IP Address<br</p';
return $this-msg;
}
function _CheckIP($temptarget)
{
if(eregi("[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}", $temptarget))
{
$f = 1;
$detail = explode(".",$temptarget);
foreach($detail as $v)
{
if($v 255 || $v < 0)
&nbs
来源:http://www.tulaoshi.com/n/20160129/1495202.html
看过《PHP IPwhois类》的人还看了以下文章 更多>>