PHP 클래스 Cml\Vendor\IpLocation

파일 보기 프로젝트 열기: linhecheng/cmlphp

공개 메소드들

메소드 설명
__construct ( string $filename = "UTFWry.dat" ) : IpLocation 构造函数,打开 QQWry.Dat 文件并初始化类中的信息
__destruct ( ) 析构函数,用于在页面执行结束后自动关闭打开的文件。
get_client_ip ( integer $type ) : mixed 获取客户端IP地址
getlocation ( string $ip = '' ) : array 根据所给 IP 地址或域名返回所在地区信息

비공개 메소드들

메소드 설명
getarea ( ) : string 返回地区信息
getlong ( ) : integer 返回读取的长整型数
getlong3 ( ) : integer 返回读取的3个字节的长整型数
getstring ( string $data = "" ) : string 返回读取的字符串
packip ( string $ip ) : string 返回压缩后可进行比较的IP地址

메소드 상세

__construct() 공개 메소드

构造函数,打开 QQWry.Dat 文件并初始化类中的信息
public __construct ( string $filename = "UTFWry.dat" ) : IpLocation
$filename string
리턴 IpLocation

__destruct() 공개 메소드

析构函数,用于在页面执行结束后自动关闭打开的文件。
public __destruct ( )

get_client_ip() 공개 정적인 메소드

获取客户端IP地址
public static get_client_ip ( integer $type ) : mixed
$type integer 返回类型 0 返回IP地址 1 返回IPV4地址数字
리턴 mixed

getlocation() 공개 메소드

根据所给 IP 地址或域名返回所在地区信息
public getlocation ( string $ip = '' ) : array
$ip string
리턴 array