微信
2016-03-10 12:16
387 查看
<?php
namespace Home\Controller;
use Think\Controller;
use Com\Wechat;
use Com\WechatAuth;
class IndexController extends Controller {
public function index()
{
$token="weixin";
$Wechat=new Wechat($token);
$data=$Wechat->request();
if($data&&is_array($data))
{
switch ($data['MsgType']) {
case 'text':
$this->Text($Wechat,$data);
break;
case 'image':
$this->replayphoto($Wechat,$data);
default:
break;
}
}
}
public function Text($Wechat,$data)
{
$Wechat->replyText($data['Content']);
}
public function replayphoto($Wechat,$data)
{
$Wechat->replyImage($data['MediaId']);
}
}
?>
namespace Home\Controller;
use Think\Controller;
use Com\Wechat;
use Com\WechatAuth;
class IndexController extends Controller {
public function index()
{
$token="weixin";
$Wechat=new Wechat($token);
$data=$Wechat->request();
if($data&&is_array($data))
{
switch ($data['MsgType']) {
case 'text':
$this->Text($Wechat,$data);
break;
case 'image':
$this->replayphoto($Wechat,$data);
default:
break;
}
}
}
public function Text($Wechat,$data)
{
$Wechat->replyText($data['Content']);
}
public function replayphoto($Wechat,$data)
{
$Wechat->replyImage($data['MediaId']);
}
}
?>
相关文章推荐
- 基于javascript制作微信聊天面板
- 解决ios下的微信打开的页面背景音乐无法自动播放
- 微点评微信软件
- 微信系列研究之-----资源文件保护的小把戏
- 仿微信聊天面板制作 javascript
- 微信php接入设计案列
- Hack微信,不一样的安全视角
- [置顶] Android 仿微信二维码名片制作,生成二维码,扫码生成名片表单信息
- 微信开发本地调试配置
- Java微信公众平台开发(6) 微信开发中的token获取
- 我们开通微信企业号啦
- github 上微信判断是否被删除的源码 以及使用解惑
- 微信公众号开发(2)jssdk文档 接口 调用
- 微信公众号开发(3)相关微信tickets补充
- 微信公众平台消息接口-java-jsp版
- 微信支付
- 移动端微信h5下ul实现横向滚动css代码
- Android友盟微信分享失败原因
- 随机生成小学四则运算练习题小程序
- 四则运算(带括号)的小程序