header("Content-type: text/html; charset=utf-8");
$access_token = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=XXXX&secret=XXXX";
$access_msg = json_decode(file_get_contents($access_token));
$token = $access_msg->access_token;
$openids = 'xxxx';
$subscribe_msg = "https://api.weixin.qq.com/cgi-bin/user/info?access_token=$token&openid=$openids";
$subscribe = json_decode(file_get_contents($subscribe_msg));
$gzxx = $subscribe->subscribe;
if($gzxx === 1){
echo "已关注";
}else{
echo "未关注";
};
?>