老師,為什么粘貼了你的代碼稍微改下就不行呢
<?php
//獲得參數(shù) signature nonce token timestamp echostr
$nonce ? ? = $_GET['nonce'];
$token ? ? = 'nihao';
$timestamp = $_GET['timestamp'];
$echostr ? = $_GET['echostr'];
$signature = $_GET['signature'];
//形成數(shù)組,然后按字典序排序
$array = array();
$array = array($nonce, $timestamp, $token);
sort($array);
//拼接成字符串,sha1加密 ,然后與signature進行校驗
$str = sha1( implode( $array ) );
if( $str ?== $signature && $echostr ){
//第一次接入weixin api接口的時候
echo ?$echostr;
exit;
}
用的是新浪云
2019-10-11
$str = sha1( implode('', $array ) );
2017-12-20
啊,為什么代碼不可以復制粘貼了
2016-09-15
服了,你倒是說加了哪行啊
跟沒說一樣
2015-10-16
我是新浪云 ? 加了行代碼就好了
2015-10-15
是不是我沒有實名認證?