Свойство | Тип | Описание | |
---|---|---|---|
$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. |
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. |
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. |
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. |
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. |