yii\validators\IpValidator::expandIPv6 PHP Метод

expandIPv6() приватный Метод

Expands an IPv6 address to it's full notation. For example 2001:db8::1 will be expanded to 2001:0db8:0000:0000:0000:0000:0000:0001
private expandIPv6 ( string $ip ) : string
$ip string the original IPv6
Результат string the expanded IPv6
    private function expandIPv6($ip)
    {
        $hex = unpack('H*hex', inet_pton($ip));
        return substr(preg_replace('/([a-f0-9]{4})/i', '$1:', $hex['hex']), 0, -1);
    }