Warning! You are currently reading the documentation for Requests 1.x.
It is recommended to upgrade to Requests 2.x at your earliest convenience.
Upgrading to Requests 2.x is fairly straight-forward.
A full list of the changes can be found in the Changelog.
Visit the documentation for Requests_IPv6
in Requests 2.x.
Class Requests_IPv6
Class to validate and to work with IPv6 addresses
This was originally based on the PEAR class of the same name, but has been
entirely rewritten.
Methods summary
public static
string
|
#
uncompress( string $ip )
Uncompresses an IPv6 address
Uncompresses an IPv6 address
RFC 4291 allows you to compress consecutive zero pieces in an address to
'::'. This method expects a valid IPv6 address and expands the '::' to
the required number of zero pieces.
Example: FF01::101 -> FF01:0:0:0:0:0:0:101 ::1 -> 0:0:0:0:0:0:0:1
Parameters
Returns
string The uncompressed IPv6 address
Copyright
2003-2005 The PHP Group
License
Author
|
public static
string
|
#
compress( string $ip )
Compresses an IPv6 address
Compresses an IPv6 address
RFC 4291 allows you to compress consecutive zero pieces in an address to
'::'. This method expects a valid IPv6 address and compresses consecutive
zero pieces to '::'.
Example: FF01:0:0:0:0:0:0:101 -> FF01::101 0:0:0:0:0:0:0:1 -> ::1
Parameters
Returns
string The compressed IPv6 address
See
|
protected static
string[]
|
#
split_v6_v4( string $ip )
Splits an IPv6 address into the IPv6 and IPv4 representation parts
Splits an IPv6 address into the IPv6 and IPv4 representation parts
RFC 4291 allows you to represent the last two parts of an IPv6 address
using the standard IPv4 representation
Example: 0:0:0:0:0:0:13.1.68.3 0:0:0:0:0:FFFF:129.144.52.38
Parameters
Returns
string[] [0] contains the IPv6 represented part, and [1] the IPv4 represented part
|
public static
boolean
|
#
check_ipv6( string $ip )
Checks an IPv6 address
Checks if the given IP is a valid IPv6 address
Parameters
Returns
boolean true if $ip is a valid IPv6 address
|