wechat开发

 1.easywechat安装

 

 2.weichat打通服务器

    function  getTest(Request $request){
        $token = 'zhenhaokeji';
        $data = $request->all();
        $signature = $data['signature'];
        $timestamp = $data['timestamp'];
        $nonce = $data['nonce'];
        $echostr = $data['echostr'];
        $arrtep = array($token, $timestamp, $nonce);
        sort($arrtep, SORT_STRING);
        $arrStr = implode($arrtep);
        $hashcode = sha1($arrStr);
        if($hashcode == $signature){
            return $echostr;
        }else{
            return false;
        }

    }
原文地址:https://www.cnblogs.com/tylerdonet/p/5910353.html