Requests_IPv6::compress( string $ip ): string

In this article

Compresses an IPv6 address

Description

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

See also

Parameters

$ipstringrequired
An IPv6 address

Return

string The compressed IPv6 address

Source

User Contributed Notes

You must log in before being able to contribute a note or feedback.