微信公众号服务器配置(校验)
public function serve(){ $echoStr = $_GET["echostr"]; if($this->checkSignature()){ echo $echoStr; exit; }}//检查签名private function checkSignature(){ $signature = $_GET["signature"]; $timestamp = $_GET["timestamp"]; $nonce = $_GET["nonce"]; $token = "xxxxxxxxxxx"; $tmpArr = array($token, $timestamp, $nonce); sort($tmpArr, SORT_STRING); $tmpStr = implode($tmpArr); $tmpStr = sha1($tmpStr); if($tmpStr == $signature){ return true; }else{ return false; }}
相关推荐
airfish000 2020-09-11
huangzonggui 2020-06-05
roddex00 2020-04-20
sanshamo 2020-03-27
furongwei 2020-03-26
zlsh00 2020-03-23
oLeiShen 2020-03-07
sapliang 2020-02-22
leodengzx 2020-01-31
meylovezn 2020-01-08
vanturman 2019-12-27
leodengzx 2019-12-27
leodengzx 2019-12-18
sapliang 2019-12-16
furongwei 2019-12-15
wq0 2019-12-14
vanturman 2019-11-09