isHostname() public static method

Depending upon the value of $allow, Internet domain names, IP addresses, and/or local network names are considered valid. The default is HOST_ALLOW_ALL, which considers all of the above to be valid.
public static isHostname ( mixed $value, integer $allow = self::ISPK_HOST_ALLOW_ALL ) : boolean
$value mixed
$allow integer bitfield for self::ISPK_HOST_ALLOW_DNS, self::ISPK_HOST_ALLOW_IP, self::ISPK_HOST_ALLOW_LOCAL
return boolean
Beispiel #1
0
 /**
  * @expectedException \Inspekt\Exception
  */
 public function testIsHostnameBadAllow3()
 {
     $input = '192.168.1.1';
     $this->assertTrue(Inspekt::isHostname($input, 8));
 }