/** * 申请消息接口的验证 * 网址接入 公众平台用户提交信息后,微信服务器将发送GET请求到 这个参数 */ public static function verification($paramArr) { $options = array('token' => '', 'signature' => '', 'timestamp' => '', 'nonce' => ''); if (is_array($paramArr)) { $options = array_merge($options, $paramArr); } extract($options); self::$TOKEN = $token; //进行验证 return self::checkSignature(array('signature' => $signature, 'timestamp' => $timestamp, 'nonce' => $nonce)); }
/** * 申请消息接口的验证 * 网址接入 公众平台用户提交信息后,微信服务器将发送GET请求到 这个参数 */ public static function verification($paramArr) { $options = array('token' => ''); if (is_array($paramArr)) { $options = array_merge($options, $paramArr); } extract($options); self::$TOKEN = $token; $signature = $_GET["signature"]; $timestamp = $_GET["timestamp"]; $nonce = $_GET["nonce"]; $echoStr = $_GET["echostr"]; //进行验证 if (self::checkSignature(array('signature' => $signature, 'timestamp' => $timestamp, 'nonce' => $nonce))) { echo $echoStr; } }