Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.htaccess 测试IP是否在范围内_.htaccess_Ip - Fatal编程技术网

.htaccess 测试IP是否在范围内

.htaccess 测试IP是否在范围内,.htaccess,ip,.htaccess,Ip,我想查看此IP219.111.71.35是否在以下IP范围内 218.224.0.0/13 219.94.128.0/17 220.104.0.0/13 我刚刚使用该站点查看IP是否在上面列表中的第2个IP范围内。但我想知道:有没有一种更简单的方法,比如IP范围测试仪之类的?谢谢 11010。11100000 . 00000000 . 00000000 218.224.0.0 11011010 . 11100000 . 00000000 . 00000000 218.224.0.0 0

我想查看此IP
219.111.71.35
是否在以下IP范围内

218.224.0.0/13
219.94.128.0/17
220.104.0.0/13
我刚刚使用该站点查看IP是否在上面列表中的第2个IP范围内。但我想知道:有没有一种更简单的方法,比如IP范围测试仪之类的?谢谢

11010。11100000 . 00000000 . 00000000   218.224.0.0
11011010 . 11100000 . 00000000 . 00000000   218.224.0.0
00000000 . 00000111 . 11111111 . 11111111   /13 (netmask)
-----------------------------------------   bitwise OR
11011010 . 11100111 . 11111111 . 11111111   218.231.255.255

$your_ip = 219.111.73.35
if (($your_ip >= 218.224.0.0) && ($your_ip <= 218.231.255.255)) {
   ... falls within range ...
}
00000000 . 00000111 . 11111111 . 11111/13(网络掩码) -----------------------------------------按位或 11011010 . 11100111 . 11111111 . 11111111 218.231.255.255 $your_ip=219.111.73.35 如果($your_-ip>=218.224.0.0)&($your_-ip