-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathexample.php
More file actions
20 lines (16 loc) · 854 Bytes
/
example.php
File metadata and controls
20 lines (16 loc) · 854 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php
require __DIR__ . "autoload.php";
use Stoneworld\Wechat\Server;
use Stoneworld\Wechat\Message;
$options = array(
'token'=>'stoneworld1992', //填写应用接口的Token
'encodingaeskey'=>'o1wze3492xoUVIc9ccTLJczO3BQ5pLfiHcKwtDEdqM9',//填写加密用的EncodingAESKey
'appid'=>'wx8ac123b21f53d722', //填写高级调用功能的appid
'appsecret'=>'4ZDHIETJ6e0oENlEkRhYwzWPTrkLdXedKcPcRjCkgQkuHtQTJ12ZhWHESowrJqS9', //填写高级调用功能的密钥
'agentid'=>'5', //应用的id
);
$weObj = new Server($options);
$weObj->on('event', function($event) {
return Message::make('text')->content(var_export($event, true));
});
echo $weObj->server(); //注意, 企业号与普通公众号不同,必须打开验证,不要注释掉