Class to validate and to work with IPv6 addresses.

package SimplePie
subpackage HTTP
copyright 2003-2005 The PHP Group
license http://www.opensource.org/licenses/bsd-license.php
link http://pear.php.net/package/Net_IPv6
author Alexander Merz
author elfrink at introweb dot nl
author Josh Peck
author Geoffrey Sneddon

 Methods

Checks if the given IP is a valid IPv6 address

checkIPv6(string $ip) : boolean
Static
codeCoverageIgnore
deprecated Use {@see SimplePie_Net_IPv6::check_ipv6()} instead
see

Parameters

$ip

string

An IPv6 address

Returns

booleantrue if $ip is a valid IPv6 address

Checks an IPv6 address

check_ipv6(string $ip) : boolean
Static

Checks if the given IP is a valid IPv6 address

Parameters

$ip

string

An IPv6 address

Returns

booleantrue if $ip is a valid IPv6 address

Compresses an IPv6 address

compress(string $ip) : string
Static

RFC 4291 allows you to compress concecutive 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

see

Parameters

$ip

string

An IPv6 address

Returns

stringThe compressed IPv6 address

Uncompresses an IPv6 address

uncompress(string $ip) : string
Static

RFC 4291 allows you to compress concecutive 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

author Alexander Merz
author elfrink at introweb dot nl
author Josh Peck
copyright 2003-2005 The PHP Group
license http://www.opensource.org/licenses/bsd-license.php

Parameters

$ip

string

An IPv6 address

Returns

stringThe uncompressed IPv6 address

Splits an IPv6 address into the IPv6 and IPv4 representation parts

split_v6_v4(string $ip) : array
Static

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

$ip

string

An IPv6 address

Returns

array[0] contains the IPv6 represented part, and [1] the IPv4 represented part