private function expandIPv6($ip) {
        // Convert to in_addr an unpack as hex
        $hex = strtolower(bin2hex(inet_pton($ip)));

        // Inject colons
        return substr(preg_replace('/([a-f0-9]{4})/', '$1:', $hex), 0, -1);
    }
private function expandIPv6($ip) {
        // Convert to in_addr an unpack as hex
        $hex = strtolower(bin2hex(inet_pton($ip)));

        // Inject colons
        return substr(preg_replace('/([a-f0-9]{4})/', '$1:', $hex), 0, -1);
    }
private function expandIPv6 ( $ ip ) { // Convert to in_addr an unpack as hex $ hex = strtolower ( bin2hex ( inet_pton ( $ ip ) ) ) ; // Inject colons return substr ( preg_replace ( '/([a-f0-9]{4})/' , '$1:' , $ hex ) , 0 , - 1 ) ; }
Expand a short IPv6

@param string $ip For instance 2a00:1b60:1011::1338
@return string 2a00:1b60:1011:0000:0000:0000:0000:1338
Expand a short IPv6