微信企业号生成菜单栏

一、

微信企业号生成菜单栏
 
二、
微信企业号生成菜单栏
 
三、
微信企业号生成菜单栏
 
四、
微信企业号生成菜单栏
 
五、
微信企业号生成菜单栏
 
六、
微信企业号生成菜单栏
七、
微信企业号生成菜单栏
八、
微信企业号生成菜单栏
九、
<?php
header("Content-type: text/html; charset=utf-8");
define("ACCESS_TOKEN", ‘wx2PjXrVLMOlOAPiWt3solXPe_vC69UTzY2IbpNqgFR_dQ_pEJ_3x3o46tfEtnLm‘);
function weixinPost($data){
        $ch = curl_init(); //初始化
        //设置参数
         curl_setopt($ch, CURLOPT_URL, "https://qyapi.weixin.qq.com/cgi-bin/menu/create?access_token=".ACCESS_TOKEN."&agentid=4");//设施url参数
         curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");//设置请求method参数
         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
         curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
         curl_setopt($ch, CURLOPT_USERAGENT, ‘Mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0)‘);
         curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
         curl_setopt($ch, CURLOPT_AUTOREFERER, 1);
         curl_setopt($ch, CURLOPT_POSTFIELDS, $data); //传值
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
         $tmpInfo = curl_exec($ch);//执行

         if (curl_errno($ch)) {//如果错误,输出一下
          return curl_error($ch);
         }
         curl_close($ch);//关闭
         return $tmpInfo;
    }
    
$data = ‘{
    "button": [
        {
            "name": "说说",
            "sub_button": [
                {
                    "type": "view",
                    "name": "搞笑说说",
                    "url":"http://www.soso.com/"
                },
                {
                    "type": "view",
                    "name": "爱情说说",
                    "url":"http://www.soso.com/"
                },
                {
                    "type": "view",
                    "name": "职场说说",
                    "url":"http://www.soso.com/"
                },
                {
                    "type": "view",
                    "name": "励志说说",
                    "url":"http://www.soso.com/"
                },
                {
                    "type": "view",
                    "name": "心情说说",
                    "url":"http://www.soso.com/"
                }
            ]
        },
        {
            "name": "文章",
            "sub_button": [
                {
                    "type": "view",
                    "name": "健身文章",
                    "url":"http://www.baidu.com/"
                 },
                {
                    "type": "view",
                    "name": "养生文章",
                    "url":"http://www.baidu.com/"
                },
                {
                    "type": "view",
                    "name": "互联网文章",
                    "url":"http://www.baidu.com/"
                },
                {
                    "type": "view",
                    "name": "教育文章",
                    "url":"http://www.baidu.com/"
                },
                {
                    "type": "view",
                    "name": "法律文章",
                    "url":"http://www.baidu.com/"
                }
            ]
        },{
            "name": "心情说",
            "sub_button": [
                {
                    "type": "view",
                    "name": "首页",
                    "url":"http://www.baidu.com/"
                 },
                {
                    "type": "view",
                    "name": "关于我们",
                    "url":"http://www.baidu.com/"
                }
            ]
        }
    ]
}‘;
    $tmpInfo = weixinPost($data);  
    echo $tmpInfo;
?>

微信企业号生成菜单栏

上一篇:Android 支付宝以及微信支付快速接入流程


下一篇:Android端富文本编辑器(EditText+Span)开源+实例+详解+细节