本文整理匯總了PHP中Wechat::sendtext方法的典型用法代碼示例。如果您正苦於以下問題:PHP Wechat::sendtext方法的具體用法?PHP Wechat::sendtext怎麽用?PHP Wechat::sendtext使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Wechat
的用法示例。
在下文中一共展示了Wechat::sendtext方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: index
public function index()
{
import("@.ORG.Weixin");
$config = $this->Config;
$wxconfig = F("wxconfig");
$user = M("user");
$data = array();
$wechatObj = new Wechat();
if ($wxconfig["wstatu"] != "") {
$data = $wechatObj->responseMsg($idx);
//接收到的
$me = $data['me'];
$guest = $data['user'];
//////////////////////*用戶打入庫-開始*///////////////
$this->adduser($guest);
if ($data['key'] == "ewm") {
$ewm = $wechatObj->ewm(2, 1);
$wechatObj->sendtext($guest, $me, $ewm);
}
$wechatObj->sendtext($guest, $me, $guest);
exit;
///////////////////////////////事件開始/////////////////////////
if ($data['type'] == "event") {
//關注
if ($data['event'] == "subscribe" || $data['event'] == "SCAN") {
if ($data['key'] == 1) {
$user = M("user")->where("wxid='" . sysmd5($guest) . "'")->setfield('vip', 1);
$map1['url'] = "http://mall.bydauto.com.cn/echo/index/store";
$map1['title'] = "vip會議標題['待定..']";
$map1['description'] = "描述的文字['待定..'],點擊進去的鏈接待定,下麵的圖片大小700x400";
$map1['thumb'] = "http://byd.gzqizhen.com/Public/byd/byd.jpg";
$wechatObj->sendimg($guest, $me, $map1);
exit;
}
if ($data['key'] == 2) {
$vip = M("user")->where("wxid='" . sysmd5($guest) . "'")->getfield('vip');
if (!$vip) {
$user = M("user")->where("wxid='" . sysmd5($guest) . "'")->setfield('vip', 2);
}
$map2['url'] = "http://mall.bydauto.com.cn/echo/index/store";
$map2['title'] = "新能源['待定..']";
$map2['description'] = "描述的文字['待定..']下麵的圖片大小700x400";
$map2['thumb'] = "http://byd.gzqizhen.com/Public/byd/byd.jpg";
$wechatObj->sendimg($guest, $me, $map2);
// $wechatObj->sendtext($guest,$me,"新能源");
exit;
}
}
}
///////////////////////////////事件結束/////////////////////////
$wechatObj->sendimg($guest, $me, $wxconfig);
} else {
M("config")->where("varname='wstatu'")->setField('value', "清理此位置可以重新設置微信接入!");
$wechatObj->valid($wxconfig["token"]);
savecache("Config");
}
}