tring compress(
String
$ip, [boolean
$force = false])
|
|
Compresses an IPv6 adress
RFC 2373 allows you to compress zeros in an adress to '::'. This function expects an valid IPv6 adress and compresses successive zeros to '::'
Example: FF01:0:0:0:0:0:0:101 -> FF01::101 0:0:0:0:0:0:0:1 -> ::1
Whe $ip is an already compressed adress the methode returns the value as is, also if the adress can be compressed further.
Example: FF01::0:1 -> FF01::0:1
To enforce maximum compression, you can set the second argument $force to true.
Example: FF01::0:1 -> FF01::1
Parameters:
Mixed getPrefixLength(
String
$ip)
|
|
Tests for a prefix length specification in the address and returns the prefix length, if exists
The method is technically identical to getNetmaskSpec() and will be dropped in a future release.
Parameters:
boolean isInNetmask(
String
$ip, String
$netmask, [int
$bits = null])
|
|
Checks if an (compressed) IP is in a specific address space.
IF the IP does not contains the number of netmask bits (F8000::FFFF/16) then you have to use the $bits parameter.
Parameters:
Array parseAddress(
String
$ipToParse, [String
$bits = null])
|
|
Returns the lowest and highest IPv6 address for a given IP and netmask specification
The netmask may be a part of the $ip or the number of netwask bits is provided via $bits
The result is an indexed array. The key 'start' contains the lowest possible IP adress. The key 'end' the highest address.
Parameters:
String removePrefixLength(
String
$ip)
|
|
Tests for a prefix length specification in the address and removes the prefix length, if exists
The method is technically identical to removeNetmaskSpec() and will be dropped in a future release.
Parameters:
Array SplitV64(
String
$ip, [Boolean
$uncompress = true])
|
|
Splits an IPv6 adress into the IPv6 and a possible IPv4 part
RFC 2373 allows you to note the last two parts of an IPv6 adress as an IPv4 compatible adress
Example: 0:0:0:0:0:0:13.1.68.3 0:0:0:0:0:FFFF:129.144.52.38
Parameters:
String uncompress(
String
$ip, [Boolean
$leadingZeros = false])
|
|
Uncompresses an IPv6 adress
RFC 2373 allows you to compress zeros in an adress to '::'. This function expects an valid IPv6 adress and expands the '::' to the required zeros.
Example: FF01::101 -> FF01:0:0:0:0:0:0:101 ::1 -> 0:0:0:0:0:0:0:1
Parameters: