//您要检测的域名
$url = '';
//您的令牌
$token='e245b6542564b812b5205f872a861fe7';
$content = get_check($token,$url);
$data = json_decode($content,true);
if($data['code'] == 200){
echo "域名正常";
}else{
echo $data['msg'];
}
function get_check($token,$domain){
$url = '/api/urlsec/vx?';
$url .= http_build_query(array(
'token' => $token
,'domain' => $domain
));
$ch = curl_init();
curl_setopt($ch,CURLOPT_TIMEOUT,5);
curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,false);
$data = curl_exec($ch);
if($data){
curl_close($ch);
return $data;
}else {
$error = curl_errno($ch);
curl_close($ch);
return false;
}
}
如果觉得《微信域名检测php 微信域名检测API接口PHP代码》对你有帮助,请点赞、收藏,并留下你的观点哦!