-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmenucreate.php
36 lines (31 loc) · 1.21 KB
/
menucreate.php
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
<?php
require 'weixin.class.php';
$ret=wxcommon::getToken();
$ACCESS_TOKEN=$ret['access_token'];
$menuPostData='{
"button":[
{
"type":"view",
"name":"发布活动",
"url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx42dbf69f8939e9a8&redirect_uri=http://lovepingping.applinzi.com/publish.php&response_type=code&scope=snsapi_base&state=1"
},
{
"type":"view",
"name":"参加活动",
"url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx42dbf69f8939e9a8&redirect_uri=http://lovepingping.applinzi.com/join.php&response_type=code&scope=snsapi_base&state=1"
},
{
"type":"view",
"name":"赞一下我们",
"url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx42dbf69f8939e9a8&redirect_uri=http://lovepingping.applinzi.com/dianzan.php&response_type=code&scope=snsapi_base&state=1"
}]
}';
// create new menu
$wxmenu=new wxmenu($ACCESS_TOKEN);
$create=$wxmenu->createMenu($menuPostData);
//get current menu
$get=$wxmenu->getMenu();
var_dump($get);
//delete current menu
//$del=$wxmenu->deleteMenu();
//var_dump($del);