GetOptionKit\ValueType\Ipv6Type::test PHP Method

test() public method

public test ( $value )
    public function test($value)
    {
        return filter_var($value, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) !== false;
    }

Usage Example

示例#1
0
 public function testIpv6Type()
 {
     $ipv6 = new Ipv6Type();
     ok($ipv6->test('2607:f0d0:1002:51::4'));
     ok($ipv6->test('2607:f0d0:1002:0051:0000:0000:0000:0004'));
     $this->assertFalse($ipv6->test('192.168.25.58'));
 }
All Usage Examples Of GetOptionKit\ValueType\Ipv6Type::test