作者 lyh

gx

... ... @@ -314,6 +314,10 @@ class LoginController extends BaseController
$strippedContent = preg_replace($pattern, '', $sourceCode); // 删除`<style>`标签及其内容
$pattern = '/<link\b[^>]*>/'; // 定义匹配 `<link>` 标签的正则表达式
$strippedContent = preg_replace($pattern, '', $strippedContent); // 删除 `<link>` 标签
$pattern = '/<script\b[^>]*>(.*?)<\/script>/s'; // 定义匹配`<script>`标签及其内容的正则表达式
$strippedContent = preg_replace($pattern, '', $strippedContent); // 删除`<script>`标签及其内容
$pattern = '/<footer\b[^>]*>(.*?)<\/footer>/s'; // 定义匹配`<script>`标签及其内容的正则表达式
$strippedContent = preg_replace($pattern, '', $strippedContent); // 删除`<script>`标签及其内容
var_dump($strippedContent);
die();
$pattern = '/>([^<]+)</'; // 定义匹配中间内容不是标签的正则表达式
... ...