-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathmenu.php
More file actions
79 lines (79 loc) · 2.06 KB
/
menu.php
File metadata and controls
79 lines (79 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
require './WeChat.class.php';
//appId
define('APPID','');
//appsecret
define('APPSECRET','');
//token
define('TOKEN','');
//appkey图灵机器人官网获得
define('APPKEY',' ');
$wechat = new WeChat(APPID,APPSECRET,TOKEN,APPKEY);
$menu = <<<JSON
{
"button": [
{
"name": "扫码",
"sub_button": [
{
"type": "scancode_waitmsg",
"name": "扫码带提示",
"key": "scancode_waitmsg",
"sub_button": [ ]
},
{
"type": "scancode_push",
"name": "扫码推事件",
"key": "scancode_push",
"sub_button": [ ]
}
]
},
{
"name": "发图",
"sub_button": [
{
"type": "pic_sysphoto",
"name": "系统拍照发图",
"key": "pic_sysphoto",
"sub_button": [ ]
},
{
"type": "pic_photo_or_album",
"name": "拍照或者相册发图",
"key": "pic_photo_or_album",
"sub_button": [ ]
},
{
"type": "pic_weixin",
"name": "微信相册发图",
"key": "pic_weixin",
"sub_button": [ ]
}
]
},
{
"name": "快捷操作",
"sub_button" : [
{
"name": "地理位置",
"type": "location_select",
"key": "location_select"
},
{
"name": "普通点击",
"type": "click",
"key": "click"
},
{
"name": "查看URL",
"type": "view",
"url" : "http://www.soso.com/"
},
]
},
]
}
JSON;
$result = $wechat->menuSet($menu);
var_dump($result);