第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

關(guān)注公眾號(hào)的時(shí)候有時(shí)候有回復(fù)信息,有時(shí)候沒有。收到的少 大部分都收不到 求解答

<?phpnamespace?app\index\controller;class?Index{
????public?function?index()????{????????
????//1.將timestamp,nonce,toke按字典順序排序??		
????$timestamp?=?$_GET['timestamp'];??		
????$nonce?=?$_GET['nonce'];??		
????$token?=?'weixin';??		
????$signature?=?$_GET['signature'];??		
????$array?=?array($timestamp,$nonce,$token);??		
????//2.將排序后的三個(gè)參數(shù)拼接之后用sha1加密??		
????$tmpstr?=?implode('',$array);??		
????$tmpstr?=?sha1($tmpstr);??		
????//3.將加密后的字符串與signature進(jìn)行對(duì)比,判斷該請(qǐng)求是否來自微信??		
????if($tmpstr?==?$signature?&&?$_GET['echostr']){		????
????header('content-type:text');		??????
????//?第一次接入微信API接口		????
????echo?$_GET['echostr'];??		????
????exit;??		
????}?else{
????	$this->responseMsg();		}????}????
????	/*接受事件推送并回復(fù)*/????
????	public?function?responseMsg()????{			
????	$postArr?=?file_get_contents("php://input");	????????
????	libxml_disable_entity_loader(true);	????????
????	$postObj?=?simplexml_load_string($postArr,?'SimpleXMLElement',?LIBXML_NOCDATA);			
????	//?判斷該數(shù)據(jù)包是否是訂閱的時(shí)間推送			
????	if(strtolower($postObj->MsgType)?==?'event'){				
????	//?如果是關(guān)注subscribe事件				
????	if(strtolower($postObj->Event)?==?'subscribe'){					
????	//?回復(fù)用戶信息					
????	$toUser?=?$postObj->FromUserName;					
????	$fromUser?=?$postObj->ToUserName;					
????	$time?=?time();					
????	$Msgtype?=?'text';					
????	//?$Content?=?'相信自己,你的選擇是對(duì)的。';					
????	$Content?=?'相信自己,你的選擇是對(duì)的';					
????	$template?=?"<xml><ToUserName><![CDATA[%s]]></ToUserName><FromUserName><![CDATA[%s]]></FromUserName><CreateTime>%s</CreateTime><MsgType><![CDATA[%s]]></MsgType><Content><![CDATA[%s]]></Content></xml>";					
????	$info?=?sprintf($template,$toUser,$fromUser,$time,$Msgtype,$Content);
????	//后面的值將會(huì)按順序填到$template里面的%s					
????	echo?$info;				}			}????}}

正在回答

1 回答

少了個(gè)sort($array);加上測(cè)一下

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

關(guān)注公眾號(hào)的時(shí)候有時(shí)候有回復(fù)信息,有時(shí)候沒有。收到的少 大部分都收不到 求解答

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)