protected function isInside ($ip, $name, $range)
	{
		
		// Single IP

		if (!is_array ($range))
		{
			if ($ip == $range)
			{
				return TRUE;
			}
		}

		// CIDR

		elseif (strpos ($name, '/') !== FALSE)
		{
			if (($ip & $range[1]) == ($range[0] & $range[1]))
			{
				return TRUE;
			}
		}

		// Start-End

		elseif (strpos ($name, '-') !== FALSE)
		{
			if (($ip >= $range[0]) && ($ip <= $range[1]))
			{
				return TRUE;
			}
		}
		
		// Not inside any range
		
		return FALSE;
		
	}
protected function isInside ($ip, $name, $range)
	{
		
		// Single IP

		if (!is_array ($range))
		{
			if ($ip == $range)
			{
				return TRUE;
			}
		}

		// CIDR

		elseif (strpos ($name, '/') !== FALSE)
		{
			if (($ip & $range[1]) == ($range[0] & $range[1]))
			{
				return TRUE;
			}
		}

		// Start-End

		elseif (strpos ($name, '-') !== FALSE)
		{
			if (($ip >= $range[0]) && ($ip <= $range[1]))
			{
				return TRUE;
			}
		}
		
		// Not inside any range
		
		return FALSE;
		
	}
protected function isInside ( $ ip , $ name , $ range ) { // Single IP if ( ! is_array ( $ range ) ) { if ( $ ip == $ range ) { return TRUE ; } } // CIDR elseif ( strpos ( $ name , '/' ) !== FALSE ) { if ( ( $ ip & $ range [ 1 ] ) == ( $ range [ 0 ] & $ range [ 1 ] ) ) { return TRUE ; } } // Start-End elseif ( strpos ( $ name , '-' ) !== FALSE ) { if ( ( $ ip >= $ range [ 0 ] ) && ( $ ip <= $ range [ 1 ] ) ) { return TRUE ; } } // Not inside any range return FALSE ; }
Return whether an IP is inside a range
@param intger $ip IP decimal to check
@param string $name IP Range name
@param string|array $range Valid IP range
@return boolean
Return whether an IP is inside a range