<?php
header(
"Content-type:application/json"
);
error_reporting
(E_ALL ^ E_WARNING);
$checkUrl
= get_headers(
'http://mp.weixinbridge.com/mp/wapredirect?url='
.
$_REQUEST
[
'url'
]);
$headerStr
= json_encode(
$checkUrl
);
$Location_behind
=
substr
(
$headerStr
,
strripos
(
$headerStr
,
"Location"
));
if
(
$Location_behind
==
'false'
){
$result
=
array
(
'code'
=> 201,
'msg'
=>
'该域名无法正常访问,暂时无法查询访问状态'
);
}
else
if
(
strpos
(
$Location_behind
,
'weixin110'
) !== false){
$result
=
array
(
'code'
=> 202,
'msg'
=>
'域名被封'
);
}
else
{
$result
=
array
(
'code'
=> 200,
'msg'
=>
'域名正常'
);
}
echo
json_encode(
$result
,JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE);
?>