? ???? ?? WeChat ?? ??? ????? PHP ??? ??? ?? ??? ???? ?? ?? ??? ??? ??? ?? ???? ?? ??? ??? ?????. ?? ????? ??. ??? ??? ???
? ?????. ? ?? ?? ?? ??? ????? ??? PHP ???? ??? ?? ??? ?? ??? ?????. ????? ?? ??? ?????.
??? ??? ???? ??? ??? ?? ??? ????? ????? ????. ??. ?? ???? ???????.
??? ?? ?? ? ??? ???, ?? ??? ??? ??? ??? ? ?? ???? ????, ?? ?? ???? ??? ??? ??? ???? ???? ????. ?? WeChat ?? ??? ?? ?????? ?? ???? ???????.
?? WeChat ?? ????? ???? ??? ??? ? ?? ???? ???? ????. ?? ??? ??? ??? ??? ? ??? ?? ??? ??? ? ??? ?? ???? ???? ??? ??? ? ? ??? ? ????. ?? ??? ??? ??? ???? ?? ??? ??? ??? ???? ?? ? ?? ?? ??? ??? ? ?? ??? ???? ?? ? ??? ????. ?? ??? ??? ??????? WeChat ??? ?????. (??? ??? ???? ?? ??? 1?? 300?????.) ??? ??? ???? ??? ??? ????? ?? ? ??? ??? ?? ?? ???? ?????? ?? ????. ??? ???? ???? ??????...
???? ??? ????? ????. ? ????? ???? ?? ?? ?? ??? ?????. ?? ?? ?? ?? ??(? ??)? ?????. ?? ? ?? WeChat ?? ???? ???? ??? ???? ?? ??? ??? ?? ?? ??? ?? ?? ??? ? ?? WeChat?? ???? ??? ?????? ??? ? ?? ??? ?? ????: wx_sample.php, ??? ??? ????:
<?php /** * wechat php test */ //define your token define("TOKEN", "weixin"); $wechatObj = new wechatCallbackapiTest(); $wechatObj->valid(); class wechatCallbackapiTest { public function valid() { $echoStr = $_GET["echostr"]; //valid signature , option if($this->checkSignature()){ echo $echoStr; exit; } } public function responseMsg() { //get post data, May be due to the different environments $postStr = $GLOBALS["HTTP_RAW_POST_DATA"]; //extract post data if (!emptyempty($postStr)){ $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA); $fromUsername = $postObj->FromUserName; $toUsername = $postObj->ToUserName; $keyword = trim($postObj->Content); $time = time(); $textTpl = "<xml> <ToUserName><![CDATA[%s]]></ToUserName> <FromUserName><![CDATA[%s]]></FromUserName> <CreateTime>%s</CreateTime> <MsgType><![CDATA[%s]]></MsgType> <Content><![CDATA[%s]]></Content> <FuncFlag>0</FuncFlag> </xml>"; if(!emptyempty( $keyword )) { $msgType = "text"; $contentStr = "Welcome to wechat world!"; $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr); echo $resultStr; }else{ echo "Input something..."; } }else { echo ""; exit; } } private function checkSignature() { $signature = $_GET["signature"]; $timestamp = $_GET["timestamp"]; $nonce = $_GET["nonce"]; $token = TOKEN; $tmpArr = array($token, $timestamp, $nonce); sort($tmpArr, SORT_STRING); $tmpStr = implode( $tmpArr ); $tmpStr = sha1( $tmpStr ); if( $tmpStr == $signature ){ return true; }else{ return false; } } } ?>
??? ??? ? ???? ????. ??? ??? ???? ?? ????? ?? ? ?? ???? URL? ?? ?? ?????. ??? ??? URL? http://www.jb51.net/wx_sample.php?? ??? ??? ??? ????? ?????. ?? ??? ???? ? ??? ? ??? ???? weixin???. ?? ?? ??? ???? ????? ???? ?????. ?? ?? ??? ??? ???? ???? ??? ??? ??? ?? ?? ???. ?? ????? ???? ?? ?? ??? ?? ????? ???. ?? ??:
//$wechatObj->valid(); $wechatObj->responseMsg();
?? ???? ??? ?? ???? ?? ???. Wechat world? ?? ?? ?????!
?? ?? ???? ??? ??? ?????? ???? ?? ???. ??? ??? ???? 1, ??? ???, 2, ??? ??? ??.
?? ???? ??? ?????? ??? ?? ??:
checkSignature()){ echo $echoStr; exit; } } public function responseMsg() { //get post data, May be due to the different environments $postStr = $GLOBALS["HTTP_RAW_POST_DATA"]; //extract post data if (!empty($postStr)){ $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA); $fromUsername = $postObj->FromUserName; $toUsername = $postObj->ToUserName; $keyword = trim($postObj->Content); $time = time(); $MsgType = $postObj->MsgType; //add $textTpl = ""; if($MsgType != 'event') { if(!empty( $keyword )) { $msgType = "text"; $contentStr = "Welcome to wechat world!"; }else{ echo "Input something..."; } } else { $msgType = "text"; $contentStr = "感謝您關注AndyYang個人博客微信小助手。\r\n". "回復【1】返回兩篇最新文章\r\n". "回復【2】返回兩篇人氣文章\r\n". "回復【3】返回兩篇熱評文章\r\n". "回復【4】返回兩篇最新技術文章\r\n". "回復【5】返回兩篇最新寫作文章\r\n". "回復其他返回搜索關鍵字的兩篇文章\r\n". "更多精彩內容,盡在:www.jb51.net。親們,請多多支持哦,謝謝~"; ; } $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr); echo $resultStr; }else { echo ""; exit; } } private function checkSignature() { $signature = $_GET["signature"]; $timestamp = $_GET["timestamp"]; $nonce = $_GET["nonce"]; $token = TOKEN; $tmpArr = array($token, $timestamp, $nonce); sort($tmpArr, SORT_STRING); //這個在新的sdk中添加了第二個參數(compare items as strings) $tmpStr = implode( $tmpArr ); $tmpStr = sha1( $tmpStr ); if( $tmpStr == $signature ){ return true; }else{ return false; } } } %s 0
?? ??? WeChat ?? ????? ???? SDK?? ??? ??? ? ?? ? ??? ??? ??? ???? ???????. ???? ?? ??, LOCATION ?? ?????. ?? ?????? ???? ???? ???? ?? ?? ? ?? ???? ?????. ??? ??? ????.
<?php define("TOKEN", "weixin"); $wechatObj = new wechatCallbackapiTest(); $wechatObj->weixin_run(); class wechatCallbackapiTest { private $fromUsername; private $toUsername; private $times; private $keyword; private $MsgType; public function responseMsg() { $postStr = $GLOBALS["HTTP_RAW_POST_DATA"]; if (!emptyempty($postStr)) { $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA); $this->fromUsername = $postObj->FromUserName; $this->toUsername = $postObj->ToUserName; $this->keyword = trim($postObj->Content); $this->time = time(); $this->MsgType = $postObj->MsgType; } else { echo "Pay attention to <a href='http://{$_SERVER['HTTP_HOST']}'>http://{$_SERVER['HTTP_HOST']}</a>,thanks!"; exit; } } public function weixin_run() { $this->responseMsg(); if($this->MsgType != 'event') { //attention $data = $this->getData(); $this->fun_xml("news", $data, count($data)); } else { $data = $this->getWelData(); $this->fun_xml("text", $data, 1); } } //type: text 文本類型, news 圖文類型 //text,array(內容),array(ID) //news,array(array(標題,介紹,圖片,超鏈接),...小于10條),條數 private function fun_xml($type, $value_arr, $count) { $con="<xml> <ToUserName><![CDATA[{$this->fromUsername}]]></ToUserName> <FromUserName><![CDATA[{$this->toUsername}]]></FromUserName> <CreateTime>{$this->times}</CreateTime> <MsgType><![CDATA[{$type}]]></MsgType>"; switch($type) { case "text" : $con.="<Content><![CDATA[$value_arr]]></Content>"; break; case "news" : $con.="<ArticleCount>{$count}</ArticleCount> <Articles>"; foreach($value_arr as $key => $v) { $con.="<item> <Title><![CDATA[{$v[0]}]]></Title> <Description><![CDATA[{$v[1]}]]></Description> <PicUrl><![CDATA[{$v[2]}]]></PicUrl> <Url><![CDATA[{$v[3]}]]></Url> </item>"; } $con.="</Articles>"; break; } echo $con."</xml>"; } private function getData() { //數據庫通過關鍵字查詢文章 //。。。。。。。。。。。。 //。。。。。。。。。。。。 //返回文章結果的數組 return $data; } private function getWelData() { $data = "感謝您關注AndyYang個人博客微信小助手。\r\n". "回復【1】返回兩篇最新文章\r\n". "回復【2】返回兩篇人氣文章\r\n". "回復【3】返回兩篇熱評文章\r\n". "回復【4】返回兩篇最新技術文章\r\n". "回復【5】返回兩篇最新寫作文章\r\n". "回復其他返回搜索關鍵字的兩篇文章\r\n". "更多精彩內容,盡在:<a href='http://www.jb51.net/'>www.jb51.net</a>。親們,請多多支持哦,謝謝~"; ; return $data; } }
??? ? ?? ????. ??? ??? ??? ????. ??? ?????? ? ???? ??? ??? WeChat ?? ? ??? ??? ?? ???? ??? ??? ? ??? ????.
? ??? PHP ?? WeChat ?? ??? ????? ??? ?? ?? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

??? ?? ??? ??? ?? JavaScript? MediareCorder API? ?? PHP ???? ???? ?????. 2. PHP? ???? ?? ??? ???? STTAPI (? : Google ?? Baidu ?? ??)? ???? ???? ?????. 3. PHP? ???? AI ??? (? : OpenAigpt)? ????. 4. ?? ?? PHP? TTSAPI (? : Baidu ?? Google ?? ??)? ???? ??? ?? ??? ?????. 5. PHP? ?? ??? ??? ??? ??? ?? ?? ??? ?????. ?? ????? PHP? ?? ???? ?? ?? ?? ??? ??? ?????.

PHP?? ?? ?? ??? ???? ?? ??? ? ???? ?? ??? ???? ?? ??? ???? ???? ????. 1. ?? ?? ??? ?? ??? URL ? ?? ??? ????. 2. UrlenCode? ???? ?? ??? ???????. 3. ? ???? ????? ?? ?? ??? ? ?? ??? ?????. 4. ???? ???? ?? ? ? ??? ??? ??? ??? ?????. 5. ??? ?? ??? ????? ?? ????? OG ??? ???? ?????. 6. XSS ??? ???? ?? ??? ??? ?????. ? ???? ??? ??? ???? ??? ?? ?? ??? ??? ???? ??? ?? ??? ?????.

AI? ??? ??? ?? ?? ? ?? ???? ????? ?? ??? ??????. 1. Baidu, Tencent API ?? ?? ?? NLP ?????? ?? ??? AI ?? ?? API? ??????. 2. PHP? ? ?? guzzle? ?? API? ???? ?? ??? ??????. 3. ?? ????? ?? ?? ??? ???? ???? ???? ??? ??? ? ????. 4. ?? ?? ? ?? ???? ?? PHP-L ? PHP_CODESNIFFER? ??????. 5. ???? ????? ???? ?? ?? ??? ?????? ??? ??????. AIAPI? ??? ? ???, ?? ??, ?? ? PHP ?? ??? ??? ???. ?? ???? PSR ??? ???, ??? ????? ????, ?? ??? ???, ????? ??? ????, X? ???????.

1. ?? ???? ??? ??? ?????? ?? ?? ??? ??, ??? ?? ???? ??? (? : ?? ???, ? ? ??), ?? ??? ?? ???? ???? ? ?? ?? ??? ??? ?? ??? ????????. 2. ?? ??? ??? ?? ? ??? ???? ?? ?? ?? ???? ?? ? ?? AUDIT ?? ??? ??? ? ????? ????? ??? ???????. 3. ?? ?? ??? ?? ??? ???????. Recaptchav3 ???? ??, ??? ?? ?? ?? ?? ??, IP ? ?? ??? ??? ??? ?? ???? ??? ?? ??? ????? ??? ???? ????? ??? ?????.

PHP? AI ??? ??? ?? ????? ??? API? ?? ?????. ??? ??? ????? ? ??? ???? ?????. API ??? ?? ?? ??? ???? ??? ??? ???? ???? ? ????. 2. ?? ?? ???? guzzle ?? curl? ???? HTTP ??? ???, JSON ??? ??? ? ???, API ? ?? ??, ??? ? ?? ??? ???? ??, ??? ?? ?? ? ? ?? ????, ??? ?? ? ?????? ?????. 3. ???? ???? ?? ???? API ??, ?? ? ??? ?? ??, ??? ?? ??, ?? ?? ? ??? ??? ??? ?????. ?? ??? ??? ??? ? ??? ???? Propt ?? ? ?? ?? ??, ??? ?? ? ?? ????, ?? ?? ?? ???? ? ??? ?? ? ???? ????? ?????.

PHP? ?????? ????? ?? ?? ?? ???? ???? ?? ???? ???? ?? ?? ???? ?????. 2. ?? ??? ???? ???? ?? ??? ?? ? ??? ??? ???? ?? API/Webhook ??? ??? ?? ???? ??? ??? ??? ??? ?????. 3. ?? ????? ?? ??, ??/???? ????, ???? ??, ???? ? ??? ?????? ????? ?? ??? ???? ???? ?? Dingtalk, SMS ?? ??? ???? ??? ?????? ???? ?? ? ??? ??? ????? ?? ??? ???? ???????.

PhpisstillRelevantinmodernenterpriseenvironments.1. Modernphp (7.xand8.x)? ??? ??, ??? ??, jitcompilation ? modernsyntax, mateitsuilableforlarge-scalepplications

MAC ?? ???? ? ??? ?? ??? ????? ?? ? ??? ????? ????. 1. ???? ???? ???? ???? ??? ?? ? ?? ????? ??? ???? ??????. 2. ????? ?? ?? ? ??? ???? ???? ?? ?? ????? ??? ???? ?????. 3. ??? ?? ??? ???? ?? ???? ?? ???? ?? ???? ?? ? ? ????. 4. ??? ????? ????? ? ?? ?? ? ??? ?? ? ??? ??????.
