参数是否必须说明
token是⽤户token
type否检测类型(wxsafe,qqsafe,默认wxsafe)
domain是检测域名
<?php
$token = 'e10adc3949ba59abbe56e057f20f883e'; //你申请的token令牌
$API_URL = 'www.vv8n/api/check.php'; //接⼝地址
$types = $_GET['type'];
$domain = $_GET['domain'];
$get_post_data = array(
'token' => $token,
'type' => $types,
'domain' => $domain,
);
$get_post_data = http_build_query($get_post_data);
//执⾏请求
$resdata = send_curl($API_URL, 'GET', $get_post_data);
//打印结果
print_r($resdata);
//封装好的CURL请求函数,⽀持POST|GET
function send_curl($API_URL, $type, $get_post_data) {
$ch = curl_init();
if ($type == 'POST') {
curl_setopt($ch, CURLOPT_URL, $API_URL);
为什么qq换不了头像了2021curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $get_post_data);
} elseif ($type == 'GET') {
curl_setopt($ch, CURLOPT_URL, $API_URL.'?'.$get_post_data);
}
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$resdata = curl_exec($ch);
curl_close($ch);
return $resdata;
}
>
返回数据:
{
code: 200,
msg: "域名正常",
number: "3"
}
发布评论