php微信域名拦截检测API接口代码

php微信域名拦截检测API接口代码<?php
/** ----------------------------------
* wx域名检测
* Time:2020-5-15
-------------------------------------- **/

header(&#39;Content-type: text/j

[时间:08-20]    [浏览:]    [放入收藏夹]    [查看详情]

php微信域名拦截检测API接口代码

<?php
/** ----------------------------------
* wx域名检测
* Time:2020-5-15
-------------------------------------- **/
 
header('Content-type: text/json;charset=utf-8'); 
if(empty($_REQUEST['url'])){
    exit('{"code":0,"msg":"参数不正确"}');
}
$api = get_headers('http://mp.weixinbridge.com/mp/wapredirect?url='.$_REQUEST['url']);
 
if($api[1] !== 'Location: '.$_REQUEST['url'].''){
        $value = array('code'=>202,'msg'=>'域名被封');
}else{
        $value = array('code'=>200,'msg'=>'域名正常');
}
echo json_encode($value,JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE);
?>

  本文转载自:精准像素:11px.cn ,感谢作者分享实用知识


标签: