感觉做防洪的应该很需要这个功能吧(虽然说我不知道防洪有没有这个功能),毕竟防洪防洪,红了的话还怎么防
<?php
$domain_list = ['1.com','2.com','3.com','4.com','5.com']; //备用域名列表
array_unshift($_SERVER['SERVER_NAME']);
for($i=0;$i<count($domain_list);$i++){
if(checkDomain($domain_list)){
//你的代码
break;
}
}
/* 定义成函数 */
function checkDomain($domain){
$result = file_get_contents('http://api.moleft.cn/qq/urlsec.php?url=http://'.$domain);
$json = json_decode($result,true);
if($json['code']>0){
return true;
}else{
return false;
}
}
?>
如无特殊说明《域名报毒之后自动切换备用域名功能实现》为博主MoLeft原创,转载请注明原文链接为:https://moleft.cn/post-132.html