Overview

Packages

  • Requests
    • Authentication
    • Cookies
    • Proxy
    • Session
    • Transport
    • Utilities

Classes

  • Requests_Hooks
  • Requests_IDNAEncoder
  • Requests_IPv6
  • Requests_IRI
  • Requests_SSL
  • Requests_Utility_CaseInsensitiveDictionary
  • Requests_Utility_FilteredIterator

Interfaces

  • Requests_Hooker
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated

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.

Package: Requests\Utilities
Located at Requests/IPv6.php
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

$ip
An IPv6 address

Returns

string
The uncompressed IPv6 address

Copyright

2003-2005 The PHP Group

License

http://www.opensource.org/licenses/bsd-license.php

Author

Alexander Merz alexander.merz@web.de
elfrink at introweb dot nl
Josh Peck
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

$ip
An IPv6 address

Returns

string
The compressed IPv6 address

See

Requests_IPv6::uncompress()
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

$ip
An IPv6 address

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 an IPv6 address

Checks if the given IP is a valid IPv6 address

Parameters

$ip
An IPv6 address

Returns

boolean
true if $ip is a valid IPv6 address
Requests 1.8.1 API Documentation API documentation generated by ApiGen