微信公众号开发时:关注回复等需要单独开发;
根据提供的url地址:
在地址中进行开发回复:
require(dirname(__FILE__) . '/api.class.php'); require(dirname(__FILE__) . '/wechat.class.php'); $weixin = new core_lib_wechat($weixinconfig); $weixin->valid(); $api = new weixinapi(); $weburl .= $api->dir; $type = $weixin->getRev()->getRevType(); $wxid = $weixin->getRev()->getRevFrom(); $data = $weixin->getRevData(); //上报地理信息 $loc = $weixin->getRev()->getUserLocation(); if ($loc) { $api->updatelocation($wxid, $loc); } $reMsg = ""; switch ($type) { case 'text': $content = $weixin->getRev()->getRevContent(); break; case 'event': $event = $weixin->getRev()->getRevEvent(); $content = json_encode($event); break; case 'image': $content = json_encode($weixin->getRev()->getRevPic()); $reMsg = "图片很美!"; break; case 'location': $content = json_encode($weixin->getRev()->getRevGeo()); $reMsg = "您所在的位置很安全!"; break; default: $reMsg = $weixinconfig['help']; } $api->saveMsg($content, $wxid, $type); if ($reMsg) { echo $weixin->text($reMsg)->reply();//公众号回复 exit; }