public static function network($ip, $cidr) { if (32 < $cidr) { return false; } if ($ip = FILTER::ipv4($ip, true)) { return long2ip(NET::ip2long($ip, true) & NET::ip2long(NET::mask($cidr, true))); } }