Wechat.php
346 字节
<?php
$signature = $_GET["signature"];
$timestamp = $_GET["timestamp"];
$nonce = $_GET["nonce"];
$echostr = $_GET["echostr"];
$token = "3bf183c4789cb8ec9601a8cfa6832bd8";
$tmpArr = array($nonce,$token,$timestamp);
sort($tmpArr,SORT_STRING);
$str = implode($tmpArr);
$sign = sha1($str);
if ($sign == $signature) {
echo $echostr;
exit;
}