IPUtils deprecated
class IPUtils (View source)
deprecated
Http utility functions.
Methods
public static
bool
checkIP(string $requestIP, string|array $ips)
Checks if an IPv4 or IPv6 address is contained in the list of given IPs or subnets.
Details
static bool
checkIP(string $requestIP, string|array $ips)
Checks if an IPv4 or IPv6 address is contained in the list of given IPs or subnets.
static bool
checkIP4(string $requestIP, string $ip)
Compares two IPv4 addresses.
In case a subnet is given, it checks if it contains the request IP.
static bool
checkIP6(string $requestIP, string $ip)
Compares two IPv6 addresses.
In case a subnet is given, it checks if it contains the request IP.
static string
anonymize(string $ip)
Anonymizes an IP/IPv6.
Removes the last byte for v4 and the last 8 bytes for v6 IPs