src/IpTools.php
public function validIpv6($ip, $strict = true)
    {
        $flags = FILTER_FLAG_IPV6;
        if ($strict) {
            $flags = FILTER_FLAG_IPV6 | FILTER_FLAG_NO_PRIV_RANGE;
        }

        if (filter_var($ip, FILTER_VALIDATE_IP, array('flags' => $flags)) !== false) {
            return true;
        }

        return false;
    }
public function validIpv6($ip, $strict = true)
    {
        $flags = FILTER_FLAG_IPV6;
        if ($strict) {
            $flags = FILTER_FLAG_IPV6 | FILTER_FLAG_NO_PRIV_RANGE;
        }

        if (filter_var($ip, FILTER_VALIDATE_IP, array('flags' => $flags)) !== false) {
            return true;
        }

        return false;
    }
public function validIpv6 ( $ ip , $ strict = true ) { $ flags = FILTER_FLAG_IPV6 ; if ( $ strict ) { $ flags = FILTER_FLAG_IPV6 | FILTER_FLAG_NO_PRIV_RANGE ; } if ( filter_var ( $ ip , FILTER_VALIDATE_IP , array ( 'flags' => $ flags ) ) !== false ) { return true ; } return false ; }
Check if given IP is valid ipv6 address and doesn't belong to private ranges

@param string $ip Ip address
@param boolean $strict If true - fail validation on reserved and private ip ranges

@return boolean
Check if given IP is valid ipv6 address and doesn t belong to private ranges