<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之旅 廣告
                ``` public static function getResourceByTemp($html) { $attr = ['title', 'alt', 'placeholder'];//指定html屬性上的文本 $getAttrArr = []; foreach ($attr as $k => $v) { preg_match_all("/{$v}=\"(.*?)\"/", $html, $get); if (!empty($get['1'])) { $getAttrArr = array_unique(array_merge($getAttrArr, $get['1'])); } } $html = preg_replace("/<!--.*?-->/is", '', $html); //刪除注釋 $html = preg_replace("/<style.*?>.*?<\/style>/is", '', $html); //刪除style標簽 $html = preg_replace("/<script.*?>.*?<\/script>/is", '', $html); //刪除js標簽 $separator = '::#::myself::#::'; //自己設定的,特有的分隔符 $html = preg_replace("/<.*?>/is", $separator, $html); $arr = array_filter(explode($separator, $html)); if (!empty($getAttrArr)) { $arr = array_filter(array_unique(array_merge($arr, $getAttrArr))); } $array = []; foreach ($arr as $k => $v) { $v = trim($v); if (!empty($v)) { if (strpos(PHP_EOL, $v)) { //有些字符里面會還有換行,再分析一次并去掉字符前后的空格。 $tmp = explode(PHP_EOL, $v); foreach ($tmp as $val) { $val = trim($val); if (!empty($val)) { $array[] = $val; } } } else { //如果沒有換行,直接賦值 $array[] = $v; } } } foreach ($array as $k => $v) { //去掉純數字的元素 if (is_numeric($v)) { unset($array[$k]); } //去掉純符號的元素 $pregStr = preg_replace("/[\x{4e00}-\x{9fa5}A-Za-z0-9]/u", '', $v); if ($v == $pregStr) { unset($array[$k]); } //去掉類似&#xe61b;這種圖標字符 if (strpos($v, '&#x') !== false && (strlen($v) == 7 || strlen($v) == 8)) { unset($array[$k]); } } $result = []; $array = array_unique($array); foreach ($array as $v) { $result[] = ['text' => trim($v), 'len' => mb_strlen($v)]; } array_multisort(array_column($result, 'len'), SORT_DESC, $result); //按字符長度倒序 return $result; } ``` ``` //獲取頁面的title,keyword,description public static function get_sitemeta($data) { if (self::isUrl($data)) { $data = file_get_contents($url); } $meta = array(); if (!empty($data)) { #Title preg_match('/<TITLE>([\w\W]*?)<\/TITLE>/si', $data, $matches); if (!empty($matches[1])) { $meta['title'] = $matches[1]; } #Keywords preg_match('/<META\s+name="keywords"\s+content="([\w\W]*?)"/si', $data, $matches); if (empty($matches[1])) { preg_match("/<META\s+name='keywords'\s+content='([\w\W]*?)'/si", $data, $matches); } if (empty($matches[1])) { preg_match('/<META\s+content="([\w\W]*?)"\s+name="keywords"/si', $data, $matches); } if (empty($matches[1])) { preg_match('/<META\s+http-equiv="keywords"\s+content="([\w\W]*?)"/si', $data, $matches); } if (!empty($matches[1])) { $meta['keywords'] = $matches[1]; } #Description preg_match('/<META\s+name="description"\s+content="([\w\W]*?)"/si', $data, $matches); if (empty($matches[1])) { preg_match("/<META\s+name='description'\s+content='([\w\W]*?)'/si", $data, $matches); } if (empty($matches[1])) { preg_match('/<META\s+content="([\w\W]*?)"\s+name="description"/si', $data, $matches); } if (empty($matches[1])) { preg_match('/<META\s+http-equiv="description"\s+content="([\w\W]*?)"/si', $data, $matches); } if (!empty($matches[1])) { $meta['description'] = $matches[1]; } } return $meta; } ```
                  <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>

                              哎呀哎呀视频在线观看