+
95
-

回答

<?php
$appid = ""; //这里请填你真实的参数值
$appsecret = ""; //这里请填你真实的参数值
$access_token = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={$appid}&secret={$appsecret}";
$access_msg = json_decode(file_get_contents($access_token));
$token = $access_msg->access_token;
$subscribe_msg = "https://api.weixin.qq.com/cgi-bin/user/info?access_token=$token&openid=".$_GET['openid'];
$subscribe = json_decode(file_get_contents($subscribe_msg));
var_dump($subscribe);
$gzxx = $subscribe->subscribe;
//
if ($gzxx === 1) {
echo "已关注";
} else {
echo "未关注";
}

网友回复

我知道答案,我要回答