狗盾综合测量平台-全网最稳定的CC/DDOS防护测试|狗盾DDOS测量墙
function cidr_match($ip, $network, $cidr) { if ( (ip2long($ip) & ~((1 << ( 32 - $cidr )) - 1) ) == ip2long($network) ) { return true; } return false; } function iscloudflareip($ipcf){ // $ipcf="103.21.244.20"; $cfips = array("103.21.244.0/22", "103.22.200.0/22", "103.31.4.0/22", "104.16.0.0/12", "108.162.192.0/18", "131.0.72.0/22", "141.101.64.0/18", "162.158.0.0/15", "172.64.0.0/13", "173.245.48.0/20", "188.114.96.0/20", "190.93.240.0/20", "197.234.240.0/22", "198.41.128.0/17"); foreach( $cfips as $network ) { $tmp = explode("/", $network); if ( cidr_match($ipcf, $tmp[0], $tmp[1]) ) { return true; } } return false; } require_once("inc/sidebar.php"); ?>
CloudFlare解析查询