<?php define("TOKEN", "自己定义"); $wechatObj = new wechatCallbackapiTest();
$wechatObj->valid(); class wechatCallbackapiTest{ public function valid(){
$echoStr = $_GET["echostr"]; if($this->checkSignature()){ echo $echoStr; exit;
} }private function checkSignature(){ $signature = $_GET["signature"];
$timestamp = $_GET["timestamp"]; $nonce = $_GET["nonce"]; $token = TOKEN;
$tmpArr = array($token, $timestamp, $nonce); sort($tmpArr); $tmpStr = implode(
$tmpArr ); $tmpStr = sha1( $tmpStr ); if( $tmpStr == $signature ){ return true;
}else{ return false; } } } ?>

技术
下载桌面版
GitHub
Gitee
SourceForge
百度网盘(提取码:draw)
云服务器优惠
华为云优惠券
腾讯云优惠券
阿里云优惠券
Vultr优惠券
站点信息
问题反馈
邮箱:[email protected]
吐槽一下
QQ群:766591547
关注微信