PHP 클래스 Longman\IPTools\Ip

저자: Avtandil Kikabidze ([email protected])
파일 보기 프로젝트 열기: akalongman/php-ip-tools 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$ip
$isv6

공개 메소드들

메소드 설명
compare ( string $ip, string $range ) : boolean Checks if an IP is part of an IP range.
ip2long ( string $ip ) : long Gets IP long representation
isLocal ( string $ip ) : boolean Checks if an IP is local
isRemote ( string $ip ) : boolean Checks if an IP is remot
isValid ( string $ip ) : boolean Checks if an IP is valid.
isValidv4 ( string $ip ) : boolean Checks if an IP is valid IPv4 format.
isValidv6 ( string $ip ) : boolean Checks if an IP is valid IPv6 format.
long2ip ( long $dec, $ipv6 = false ) : string Gets IP string representation from IP long
match ( string $ip, $ranges ) : boolean Checks if an IP is part of an IP range.
matchRange ( $ip, $range )

보호된 메소드들

메소드 설명
processWithAsterisk ( string $range ) : boolean Checks if an IP is part of an IP range.
processWithMinus ( string $range ) : boolean Checks if an IP is part of an IP range.
processWithSlash ( string $range ) : boolean Checks if an IP is part of an IP range.

메소드 상세

compare() 공개 정적인 메소드

Checks if an IP is part of an IP range.
public static compare ( string $ip, string $range ) : boolean
$ip string IPv4/IPv6
$range string IP range specified in one of the following formats: Wildcard format: 1.2.3.* OR 2001:cdba:0000:0000:0000:0000:3257:* CIDR format: 1.2.3/24 OR 1.2.3.4/255.255.255.0 Start-End IP format: 1.2.3.0-1.2.3.255 OR 2001:cdba:0000:0000:0000:0000:3257:0001-2001:cdba:0000:0000:0000:0000:3257:1000
리턴 boolean true if IP is part of range, otherwise false.

ip2long() 공개 정적인 메소드

Gets IP long representation
public static ip2long ( string $ip ) : long
$ip string IPv4 or IPv6
리턴 long If IP is valid returns IP long representation, otherwise -1.

isLocal() 공개 정적인 메소드

Checks if an IP is local
public static isLocal ( string $ip ) : boolean
$ip string IP
리턴 boolean true if the IP is local, otherwise false

isRemote() 공개 정적인 메소드

Checks if an IP is remot
public static isRemote ( string $ip ) : boolean
$ip string IP
리턴 boolean true if the IP is remote, otherwise false

isValid() 공개 정적인 메소드

Checks if an IP is valid.
public static isValid ( string $ip ) : boolean
$ip string IP
리턴 boolean true if IP is valid, otherwise false.

isValidv4() 공개 정적인 메소드

Checks if an IP is valid IPv4 format.
public static isValidv4 ( string $ip ) : boolean
$ip string IP
리턴 boolean true if IP is valid IPv4, otherwise false.

isValidv6() 공개 정적인 메소드

Checks if an IP is valid IPv6 format.
public static isValidv6 ( string $ip ) : boolean
$ip string IP
리턴 boolean true if IP is valid IPv6, otherwise false.

long2ip() 공개 정적인 메소드

Gets IP string representation from IP long
public static long2ip ( long $dec, $ipv6 = false ) : string
$dec long IPv4 or IPv6 long
리턴 string If IP is valid returns IP string representation, otherwise ''.

match() 공개 정적인 메소드

Checks if an IP is part of an IP range.
public static match ( string $ip, $ranges ) : boolean
$ip string IPv4/IPv6
리턴 boolean true if IP is part of range, otherwise false.

matchRange() 공개 정적인 메소드

public static matchRange ( $ip, $range )

processWithAsterisk() 보호된 정적인 메소드

Checks if an IP is part of an IP range.
protected static processWithAsterisk ( string $range ) : boolean
$range string IP range specified in one of the following formats: Wildcard format: 1.2.3.* OR 2001:cdba:0000:0000:0000:0000:3257:*
리턴 boolean true if IP is part of range, otherwise false.

processWithMinus() 보호된 정적인 메소드

Checks if an IP is part of an IP range.
protected static processWithMinus ( string $range ) : boolean
$range string IP range specified in one of the following formats: Start-End IP format: 1.2.3.0-1.2.3.255 OR 2001:cdba:0000:0000:0000:0000:3257:0001-2001:cdba:0000:0000:0000:0000:3257:1000
리턴 boolean true if IP is part of range, otherwise false.

processWithSlash() 보호된 정적인 메소드

Checks if an IP is part of an IP range.
protected static processWithSlash ( string $range ) : boolean
$range string IP range specified in one of the following formats: CIDR format: 1.2.3/24 OR 1.2.3.4/255.255.255.0
리턴 boolean true if IP is part of range, otherwise false.

프로퍼티 상세

$ip 보호되어 있는 정적으로 프로퍼티

protected static $ip

$isv6 보호되어 있는 정적으로 프로퍼티

protected static $isv6