|
...
|
...
|
@@ -301,5 +301,23 @@ class LoginController extends BaseController |
|
|
|
}
|
|
|
|
|
|
|
|
public function ceshi(){
|
|
|
|
$url = 'https://demo.globalso.site/';
|
|
|
|
$contextOptions = [
|
|
|
|
'ssl' => [
|
|
|
|
'verify_peer' => false,
|
|
|
|
'verify_peer_name' => false,
|
|
|
|
],
|
|
|
|
];
|
|
|
|
$context = stream_context_create($contextOptions);
|
|
|
|
$sourceCode = file_get_contents($url, false, $context);
|
|
|
|
$pattern = '/<style\b[^>]*>(.*?)<\/style>/s'; // 定义匹配`<style>`标签及其内容的正则表达式
|
|
|
|
$strippedContent = preg_replace($pattern, '', $sourceCode); // 删除`<style>`标签及其内容
|
|
|
|
$pattern = '/<link\b[^>]*>/'; // 定义匹配 `<link>` 标签的正则表达式
|
|
|
|
$strippedContent = preg_replace($pattern, '', $strippedContent); // 删除 `<link>` 标签
|
|
|
|
$pattern = '/>([^<]+)</'; // 定义匹配中间内容不是标签的正则表达式
|
|
|
|
$matches = array();
|
|
|
|
preg_match_all($pattern, $strippedContent, $matches);
|
|
|
|
$textContentArray = $matches[1];
|
|
|
|
var_dump($textContentArray);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|