<?php // 页面编码 header("Content-type:application/json"); // 隐藏WARNING error_reporting(E_ALL ^ E_WARNING); // 获取headers $checkUrl = get_headers('http://mp.weixinbridge.com/mp/wapredirect?url='.$_REQUEST['url']); $headerStr = json_encode($checkUrl); // 提取Location后面的 $Location_behind = substr($headerStr, strripos($headerStr, "Location")); // 判断域名状态 if($Location_behind == 'false'){ // 该域名无法正常访问 $result = array( 'code' => 201, 'msg' => '该域名无法正常访问,暂时无法查询访问状态' ); }else if(strpos($Location_behind,'weixin110') !== false){ // Location后面包含weixin110就是被封了 // 域名被封 $result = array( 'code' => 202, 'msg' => '域名被封' ); }else{ // 域名被封 $result = array( 'code' => 200, 'msg' => '域名正常' ); } // 输出JSON echo json_encode($result,JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE); ?>
php教程
php检测域名是否被微信封锁
我的站长站
2023-01-13
共人阅读
上一篇:php小米运动API接口源码
下一篇:快手短视频去水印API接口源码
最新更新
-
在线MD5解密源代码分享
<?php// 检查是否提交了表单if ($_SERVER['REQUEST_METHOD'] === 'POST') { // 设置 AP...
-
PHP删除空白换行教程
str_replace()函数$text = "这是第一行\n这是第二行\n这是第三行";$text = str_replace(array("\r", "\...
-
PHP去除字符串两边空格、空字符串、换行符方法
trim()函数方法$str = " Hello World! ";$trimmed = trim($str);echo $trimmed;preg_replace()函数方法$s...
-
php判断字符是否为数字或字母教程
ctype_alnum() 函数ctype_alnum() 函数检查字符串中的所有字符是否都是字母或数字。$char = 'a'; /...
-
PHP读取TXT文本内容方法大全
fread函数方法<?php$file_path = "test.txt";if(file_exists($file_path)){$fp = fopen($file_path,"r");$s...