public function validateIP($ipAddress = null)
    {
        if ($ipAddress === null) {
            $parsed = parse_url($this->uri);
            $ipAddress = isset($parsed['host']) ? $parsed['host'] : null;
        }
        return (
            filter_var($ipAddress, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) ||
            filter_var(trim($ipAddress, '[]'), FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)
        );
    }
public function validateIP($ipAddress = null)
    {
        if ($ipAddress === null) {
            $parsed = parse_url($this->uri);
            $ipAddress = isset($parsed['host']) ? $parsed['host'] : null;
        }
        return (
            filter_var($ipAddress, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) ||
            filter_var(trim($ipAddress, '[]'), FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)
        );
    }
public function validateIP ( $ ipAddress = null ) { if ( $ ipAddress === null ) { $ parsed = parse_url ( $ this -> uri ) ; $ ipAddress = isset ( $ parsed [ 'host' ] ) ? $ parsed [ 'host' ] : null ; } return ( filter_var ( $ ipAddress , FILTER_VALIDATE_IP , FILTER_FLAG_IPV4 ) || filter_var ( trim ( $ ipAddress , '[]' ) , FILTER_VALIDATE_IP , FILTER_FLAG_IPV6 ) ) ; }
Validate IPv4 or IPv6

@param  string|null $ipAddress
@return bool
Validate IPv4 or IPv6