开发的公众账号怎样和ThinkPHP框架进行关联?
//ThinkPHP框架目录下indexAction引入下述方法
public function echoStr()
{
$signature = $_GET["signature"];
$timestamp = $_GET["timestamp"];
$nonce = $_GET["nonce"];
$echostr = $_GET['echostr'];
$token = 'weixin';
$tmpArr = array($token, $timestamp, $nonce);
sort($tmpArr, SORT_STRING);
$tmpStr = implode( $tmpArr );
$tmpStr = sha1( $tmpStr );
//首次配置开发环境
if( $tmpStr == $signature && $echostr)
{
echo $echostr;
}else{
//事件处理程序
}
}