You are here

public function Cleantalk::net_match in Anti Spam by CleanTalk 8

From http://php.net/manual/en/function.ip2long.php#82397

File

src/Cleantalk.php, line 587

Class

Cleantalk
Cleantalk class create request

Namespace

Drupal\cleantalk

Code

public function net_match($CIDR, $IP) {
  list($net, $mask) = explode('/', $CIDR);
  return (ip2long($IP) & ~((1 << 32 - $mask) - 1)) == ip2long($net);
}