微信接入

微信接入

function checkSignature()
    {
        $signature = $_GET["signature"]; 
        $timestamp = $_GET["timestamp"];
        $nonce = $_GET["nonce"];
        $token = 'kakasdfkjadkdl2sakdflkjfk';  //自定义token
        $tmpArr = array($token, $timestamp, $nonce);
        sort($tmpArr);
        $tmpStr = implode( $tmpArr );
        $tmpStr = sha1( $tmpStr );

        if( $tmpStr == $signature ){
            return true;
        }else{
            return false;
        }
    }

微信接口域名有多个,越近延时更低,稳定性更好
通用域名(api.weixin.qq.com),使用该域名将访问官方指定就近的接入点;
上海域名(sh.api.weixin.qq.com),使用该域名将访问上海的接入点;
深圳域名(sz.api.weixin.qq.com),使用该域名将访问深圳的接入点;
香港域名(hk.api.weixin.qq.com),使用该域名将访问香港的接入点。

猜你喜欢

转载自blog.csdn.net/qq_35703476/article/details/84030838
今日推荐