GetOptionKit\ValueType\Ipv4Type::test PHP Method

test() public method

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

Usage Example

Example #1
0
 public function testIpv4Type()
 {
     $ipv4 = new Ipv4Type();
     ok($ipv4->test('192.168.25.58'));
     ok($ipv4->test('8.8.8.8'));
     $this->assertFalse($ipv4->test('2607:f0d0:1002:51::4'));
 }
All Usage Examples Of GetOptionKit\ValueType\Ipv4Type::test