1. 程式人生 > >公眾號/小程式更改token

公眾號/小程式更改token

public function token() { $token = 'token';//微信-客服訊息TOKEN(令牌)微信要更改的token必須是這個 $signature = $_GET["signature"]; $timestamp = $_GET["timestamp"]; $nonce = $_GET["nonce"];   $tmpArr = array($token, $timestamp, $nonce); sort($tmpArr, SORT_STRING); $tmpStr = implode($tmpArr); $tmpStr = sha1($tmpStr);   if ($tmpStr == $signature) { echo $_GET['echostr']; } else { echo '對不起,你程式出錯了'; } }