<? php//将timestamp,nonce,token按字典序排序 $timestamp = $_GET['timestamp']; $nonce = $_GET['nonce']; $token = 'TOKEN'; $signature = $_GET['signature']; $echostr = $_GET['echostr'] $arr = array($timestamp,$nonce,$token); sort($arr,SORT_STRING); //将排序后的数组拼接成字符串 $tmpstr =implode($arr); $tmpstr =sha1($tmpstr); //将加密后的字符串进行对比 if($tmpstr == $signature) { echo $echostr; exit; }
添加回答
举报
0/150
提交
取消