亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

微信菜單的實現

微信菜單的實現

PHP
phppre 2016-11-03 12:45:00
function definedItem(){ header("Content-type:text/html;charset=utf-8"); $appid="wx05d9393305accd18"; $appsecret="574949930358aeec6ead7e58abfb1522"; $url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=".$appid."&secret=".$appsecret; $res=$this->http_curl($url,'get','json'); echo $access_token=$res['access_token']; $url = 'https://api.weixin.qq.com/cgi-bin/menu/create?access_token='.$access_token; $postArr=array( 'button'=>array( array( 'name'=>urlencode('菜單一'), 'type'=>'click', 'key'=>'item1', ), array( 'name'=>urlencode('菜單二'), 'type'=>'click', 'key'=>'item1', ), array( 'name'=>urlencode('菜單二'), 'type'=>'click', 'key'=>'item1', ),? ), ); echo '<hr />'; var_dump($postArr); echo '<hr />'; echo $postJson=urldecode(json_encode($postArr)); $res = $this->http_curl($url,'post','json',$postJson); var_dump($res); }這段代碼這么讓他調用啊
查看完整描述

1 回答

已采納
?
慕田峪3555374

TA貢獻137條經驗 獲得超18個贊

直接調用這個方法就可以了啊,只要調一次就可以生成菜單了,以后除非有更改了再調重新生成新的菜單

查看完整回答
反對 回復 2016-11-05
  • 1 回答
  • 0 關注
  • 1305 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號