|
...
|
...
|
@@ -314,6 +314,15 @@ class LoginController extends BaseController |
|
|
|
$strippedContent = preg_replace($pattern, '', $sourceCode); // 删除`<style>`标签及其内容
|
|
|
|
$pattern = '/<link\b[^>]*>/'; // 定义匹配 `<link>` 标签的正则表达式
|
|
|
|
$strippedContent = preg_replace($pattern, '', $strippedContent); // 删除 `<link>` 标签
|
|
|
|
var_dump($strippedContent);
|
|
|
|
$pattern = '/<[^>]*>(.*?)<\/[^>]*>/'; // 定义匹配任意标签的正则表达式
|
|
|
|
$matches = array();
|
|
|
|
preg_match_all($pattern, $strippedContent, $matches);
|
|
|
|
$tagContentArray = array();
|
|
|
|
foreach ($matches[0] as $index => $tag) {
|
|
|
|
if ($matches[1][$index] != '') {
|
|
|
|
$tagContentArray[] = $matches[1][$index];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var_dump($tagContentArray);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|