src/Net.php
public static function isIpIn($ipAddr, $net, $mask)
	{
		// doesn't check for the return value of ip2long
		$ipAddr	= ip2long($ipAddr);
		$rede	= ip2long($net);
		$mask	= ip2long($mask);
		$res	= $ipAddr & $mask;	// AND
		return ($res == $rede);
	}
public static function isIpIn($ipAddr, $net, $mask)
	{
		// doesn't check for the return value of ip2long
		$ipAddr	= ip2long($ipAddr);
		$rede	= ip2long($net);
		$mask	= ip2long($mask);
		$res	= $ipAddr & $mask;	// AND
		return ($res == $rede);
	}
public static function isIpIn ( $ ipAddr , $ net , $ mask ) { // doesn't check for the return value of ip2long $ ipAddr = ip2long ( $ ipAddr ) ; $ rede = ip2long ( $ net ) ; $ mask = ip2long ( $ mask ) ; $ res = $ ipAddr & $ mask ; // AND return ( $ res == $ rede ) ; }
is IP address in given subnet?

@param string $ipAddr IP address
@param string $net    network
@param string $mask   netmask

@return boolean
is IP address in given subnet?