1234567891011121314151617181920 |
- <?php
- include "wechat.class.php";
- $options = array(
- 'token'=>'tokenaccesskey' //填写你设定的key
- );
- $weObj = new Wechat($options);
- $weObj->valid();
- $type = $weObj->getRev()->getRevType();
- switch($type) {
- case Wechat::MSGTYPE_TEXT:
- $weObj->text("hello, I'm wechat")->reply();
- exit;
- break;
- case Wechat::MSGTYPE_EVENT:
- break;
- case Wechat::MSGTYPE_IMAGE:
- break;
- default:
- $weObj->text("help info")->reply();
- }
|