public static function validateInternetIPAddress($addr, $private = false, $loopback = false){

		$flags = \FILTER_FLAG_IPV4 | \FILTER_FLAG_NO_RES_RANGE;

		if(!$private){
			$flags |= \FILTER_FLAG_NO_PRIV_RANGE;
		}

		$ip = \trim($addr);
		
		if(\filter_var($ip, \FILTER_VALIDATE_IP, $flags) === false){
			return false;
		}

		$octets = \explode('.', $ip);

		if(\count($octets) !== 4){
			return false;
		}

		foreach($octets as $octet){
			if(!\is_int($octet) || !Number::between($octet, 0, 255)){
				return false;
			}
		}

		if($loopback && $octets[0] === '127'){
			return false;
		}

		return true;

	}