<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                [TOC] # 簡介 `https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140453` 當普通微信用戶向公眾賬號發消息時,微信服務器將POST消息的XML數據包到開發者填寫的URL上。 6大接收接口 文本(text)、圖片(image)、語音(voice)、視頻(video)、地理位置(location)、鏈接(link) # 消息保存到本地 ~~~ // 構造方法 public function __construct() { // 判斷是否是第1次接入 echostr if ( !empty($_GET['echostr'])) { echo $this->checkSign(); } else { // 接受處理數據 $this->acceptMsg(); } } ~~~ ~~~ /** * 接收公眾號發過來的數據 * @return [type] [description] */ private function acceptMsg(){ // 獲取原生請求數據 $xml = file_get_contents('php://input'); $this->writeLog($xml); } /** * 把微信傳給你的,寫入日志 * @param string $xml 寫入的xml * @param int|integer $flag 標識 1:請求 2:發送 * @return [type] [description] */ private function writeLog(string $xml,int $flag=1){ $flagstr = $flag == 1 ? '接受' : '發送'; $prevstr = '【'.$flagstr.'】'.date('Y-m-d')."-----------------------------\n"; $log = $prevstr.$xml."\n---------------------------------------------\n"; // 寫日志 追加的形式去寫入 file_put_contents('wx.xml',$log,FILE_APPEND); return true; } ~~~ 這樣消息的xml就保存到wx.xml 里面日志字段的意思 ![](https://box.kancloud.cn/408ac87ea669a297543aa0dace9af80c_1236x522.png) ~~~ <xml><ToUserName><![CDATA[gh_30c57421b15c]]></ToUserName> 公眾號的id <FromUserName><![CDATA[oZK8m5uhp1Wzi3w8RjgDCINBTRrY]]></FromUserName> openid公眾號中對應用戶唯一標識(重要) <CreateTime>1562414627</CreateTime> 創建時的時間戳 <MsgType><![CDATA[text]]></MsgType> 類型 <Content><![CDATA[你們]]></Content> 內容 <MsgId>22368397313442987</MsgId> 消息id </xml> ~~~ 其他接收類型的看微信文檔
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看