PHP code shields China's IP address
does not want to be visited by domestic people. The following methods can be used:
1. from APNIC to obtain a national and regional IP segment data [url=ftp://ftp.apnic.net/apnic/dbase/data/ country-ipv4.lst:1msa83z5]ftp://ftp.apnic.net/apnic/ Dbase/data/country-ipv4.lst[/url:1msa83z5]
2. sorted out Chinese data (using Excel's data screening function)
[color=#FF0000] not to shield the IP segment of your own, or you would not be able to access it yourself! [/color]
3. writes PHP code as follows
[code].lt; php
function ipCIDRCheck ($IP, $CIDR) {
R / > $ip_mask = ~ ((1.Lt;.Lt; ((32 - $mask)) - 1);
$ip_ip = ip2long ($IP);
$ip_ip_net = $ip_ip. 3
60.208/12
60.232/15
60.235/16
60.245.128/17
60.247/16
60.252/16
60.253.128/17
60.255/16
Eof;
$subnetarray=explode. .86.219 in =.gt; ".$subnet;
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /