<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>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                測試頁面f3.php展示: ~~~ <?php function http_curl($url,$data=null){//封裝curl // 1. 初始化 $ch = curl_init(); // 2. 設置選項,包括URL curl_setopt($ch,CURLOPT_URL,$url); //curl_setopt($ch,CURLOPT_HEADER,0); //下面兩個是php5.6版本需加上才能實現 curl_setopt($ch,CURLOPT_SAFE_UPLOAD, FALSE); curl_setopt($ch,CURLOPT_SSL_VERIFYHOST, FALSE); if(!empty($data)){ curl_setopt($ch,CURLOPT_POST,1); curl_setopt($ch,CURLOPT_POSTFIELDS,$data); } curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);//測試號寫上這個是跳過SSL證書檢查,返回結果才不會null; curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);//禁止curl資源直接輸出 // 3.抓取url并把它傳遞給服務器 $opt=curl_exec($ch); // 4. 釋放curl句柄 curl_close($ch); return $opt; } function get_token(){//獲取access_token $appid="wx165112bf167af76c"; $secret="c65b22bfcf03fdd98504eac299701b03"; $url="https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={$appid}&secret={$secret}"; $json=http_curl($url); $result=json_decode($json); return $result->access_token; } $token=get_token(); //var_dump($token); $type="image"; //組裝圖片在Windows服務器上,格式示例為:”@F:\israel\upload\winter.jpg”,而在Linux服務器上,格式示例為:”@home/israel/upload/winter.jpg”。 //$path="C:\ftp\wx\xiaotu.jpg"; $path=dirname(__FILE__)."/xiaotu.jpg"; //組裝路徑 $data=array("media"=>"@".$path); $url="http://file.api.weixin.qq.com/cgi-bin/media/upload?access_token={$token}&type={$type}"; $arr=http_curl($url,$data); var_dump($arr); ?> ~~~ 注意:1.我用的測試號需要跳過SSL證書檢查才可 ~~~ curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false); ~~~ 注意:2.php5.6版本報錯 ![](https://box.kancloud.cn/397c5c1ae2d5f883d81f7af1f5b320e6_771x80.png) 需要加上以下兩個代碼 ~~~ curl_setopt($ch,CURLOPT_SAFE_UPLOAD, FALSE); curl_setopt($ch,CURLOPT_SSL_VERIFYHOST, FALSE); ~~~ 最終效果圖: ![](https://box.kancloud.cn/88128763be66a6e9319703e15ca08d93_1112x238.png)
                  <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>

                              哎呀哎呀视频在线观看