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 回答
- 1 回答
- 0 关注
- 1258 浏览
添加回答
举报
0/150
提交
取消