微信开发验证代码

 

$timestamp = $_GET['timestamp'];
$nonce		=$_GET['nonce'];
$token ='weixin';
$signature = $_GET["signature"];
$tmpArr = array($timestamp,$nonce,$token);
sort($tmpArr);
$tmpStr = implode('',$tmpArr);
$tmpStr = sha1($tmpStr);
if( $tmpStr == $signature){
    $echoStr= $_GET['echostr'];
    echo $echoStr;
    exit;
}else{
    echo  'xx';
}

来自于datou:https://github.com/datou-leo/ci

 

posted @ 2015-09-02 12:26  开源  阅读(183)  评论(0)    收藏  举报