Use wechat to open some H5 pages of the company, prompting you to stop visiting the page. After a search, it was found that the domain name was blocked by wechat. Finally found a wechat domain name detection interface on the Internet, can be very convenient to solve this problem. Wechat domain name interception and detection interface from wechat domain name interception and detection – Dragonfly software

Note: Remember to replace the API Token below, which is displayed in user center – Member information after login.


      
// Your API Token is available in the user center
$apiToken = "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *";
// The address or domain name to check
$reqUrl = "wx.horocn.com";
$url = sprintf("https://wx.horocn.com/api/v1/wxUrlCheck?api_token=%s&req_url=%s", $apiToken, $reqUrl);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
$responseBody = curl_exec($ch);
$responseArr = json_decode($responseBody, true);
if(json_last_error() ! = JSON_ERROR_NONE) {echo "JSON parsing interface result error \n";
    return;
}
if (isset($responseArr['code']) && $responseArr['code'] = =0) {
    // The interface returns correctly
    $responseArr['data']['status']
    // OK indicates that the vm is normal. Blocked indicates that the VM is blocked
    printf("Test address (%s) in: %s\n state", $reqUrl, $responseArr['data'] ['status']);
} else {
    printf("Interface error: %s\n", var_export($responseArr, true));
}
Copy the code