请问,小程序消息推送配置总是返回Token校验失败,请问这代码哪里错了?
public function index(){
$token = ‘token’;
$timestamp = $_GET[“timestamp”];
$nonce = $_GET[“nonce”];
$signature = $_GET[“signature”];
$echostr = $_GET[“echostr”];
$tmpArr = array($token, $timestamp, $nonce);
sort($tmpArr);
$tmpStr = implode( $tmpArr );
$tmpStr = sha1( $tmpStr );
if( $tmpStr == $signature ){
echo $echostr;
}else{
echo false;
}
}