开发——创建⾃定义菜单(PHP版)<?php
include "TokenUtil.php";
//TokenUtil::build_access_token();
$access_token = TokenUtil::read_token();
getSucaiList($access_token);
function getSucaiList($token){
$url = 'api.weixin.qq/cgi-bin/menu/create?access_token='.$token;
$Data = '{
"button": [
{
"type": "click",
"name": "哈哈哈",
"key": "V1001_TODAY_MUSIC"
},
{
"name": "影视",
"sub_button": [
{
"type": "view",
"name": "搜索",
"url": "www.soso/"
},
{
"type": "click",
"name": "赞⼀下我们",
"key": "V1001_GOOD"
}
开发程序]
}
]
}';
//初始化
$ch = curl_init();
/
/设置参数
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt ( $ch, CURLOPT_POST, true );
curl_setopt ( $ch, CURLOPT_POSTFIELDS, $Data);
curl_setopt ( $ch, CURLOPT_HEADER, false );
//采集
$output = curl_exec($ch);
//关闭
echo$output;
curl_close($ch);
}
>
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论