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

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                ## 1 截取文章里的鏈接 ```php $pattern = '~[a-z]+://\S+~'; preg_match_all($pattern, $link, $out) if (empty($out[0])) exit('請輸入帶有鏈接的文本'); $link = $out[0][0]; ``` ## 2 curl模擬瀏覽器請求的方法 > 最好使用 GuzzleHttp 插件 ```php composer require guzzlehttp/guzzle ``` ```php $headers = [ 'cookie' => '', 'user-agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36', ]; $client = new Client([ 'verify' => false, 'allow_redirects' => [ 'max' => 0, ], ]); $response = $client->get($link,['headers' => $headers]); $data = $response->getBody()->getContents(); ``` > curl 方式 ```php $cookie = ""; $request_link='';//請求鏈接 $post_data = '';//請求數據 $referer='';//刷新鏈接 $agent='';//代理 $header=[];//頭部信息 $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$request_link); curl_setopt($ch,CURLOPT_HTTPHEADER,$header); curl_setopt($ch, CURLOPT_COOKIE, $cookie); curl_setopt($ch, CURLOPT_REFERER,$referer); curl_setopt($ch,CURLOPT_USERAGENT,$agent); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate'); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_TIMEOUT, 5); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); $output = curl_exec($ch); curl_close($ch); return $output; ``` ## 3 通過域名獲取IP的方法 ```php gethostbyname($host) ``` ## 4 隨機生成字符 ```php $chars = [ 1 => '0123456789abcdefghigklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', 2 => '123456789', 3 => 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_ []{}<>~`+=,.;:/?|', 4 => 'abcdefghigklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' ]; $str = ''; for ($i = 0; $i < $length; $i++) { $str .= $chars[$type][mt_rand(0, strlen($chars[$type]) - 1)]; } return $str; ``` ## 5 隨機生成訂單號 ```php $y = date('y'); $m=date('m'); $d=date('d'); $h=date('h'); $i=date('i'); $s=date('s'); $date=ceil($y+$m+$d).ceil($h+$i+$s); $digits = intval($digits); if ($digits < 14) return '隨機單號大于14字符'; $digits = $digits - strlen($date) - strlen($prefix); if ($digits < 0) return '隨機單號生成失敗'; $rand = ''; $num = floor($digits / 10); for ($i = 0; $i < $num; $i++) { $rand .= str_pad(mt_rand(1, (int)9999999999), 10, '0', STR_PAD_LEFT); } if ($digits % 10 != 0) { $rand .= str_pad(mt_rand(1, (int)substr(9999999999, 0, $digits - ($num * 10))), $digits - ($num * 10), '0', STR_PAD_LEFT); } $order_number = $prefix . $date . $rand; return $order_number; ``` ## 6 截取字符串,兩個字符中間的內容 ```php $string = ' ' . $string; $ini = strpos($string, $start); if ($ini == 0) return ''; $ini += strlen($start); $len = is_null($end)?strlen($string)-$ini:strpos($string, $end, $ini) - $ini; return substr($string, $ini, $len); ```
                  <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>

                              哎呀哎呀视频在线观看