配置测试账号
遇到困难:需要⼀个URL
再来配置Ngrok和apache,让能够访问到你
就收代码
$signature = $_GET["signature"];
$timestamp = $_GET["timestamp"];
$nonce = $_GET["nonce"];
$echostr = $_GET['echostr'];
网$token = 'laughing';
$tmpArr = array($token, $timestamp, $nonce);
sort($tmpArr, SORT_STRING);//将token、timestamp、nonce三个参数由⼩到⼤进⾏排序$tmpStr = implode( $tmpArr );//将三个参数字符串拼接成⼀个字符串
$tmpStr = sha1( $tmpStr );//进⾏sha1加密
if( $tmpStr == $signature )
{
echo( $echostr );//返回echostr参数
}
else
echo "Error";
exit;
发布评论