正在显示
1 个修改的文件
包含
4 行增加
和
2 行删除
| @@ -318,8 +318,10 @@ class LoginController extends BaseController | @@ -318,8 +318,10 @@ class LoginController extends BaseController | ||
| 318 | die(); | 318 | die(); |
| 319 | $pattern = '/>([^<]+)</'; // 定义匹配中间内容不是标签的正则表达式 | 319 | $pattern = '/>([^<]+)</'; // 定义匹配中间内容不是标签的正则表达式 |
| 320 | $matches = array(); | 320 | $matches = array(); |
| 321 | - preg_match_all($pattern, $strippedContent, $matches); | ||
| 322 | - $textContentArray = $matches[1]; | 321 | + preg_match_all($pattern, $content, $matches); |
| 322 | + $textContentArray = array_filter($matches[1], function($item) { | ||
| 323 | + return !empty(trim($item)); | ||
| 324 | + }); | ||
| 323 | var_dump($textContentArray); | 325 | var_dump($textContentArray); |
| 324 | } | 326 | } |
| 325 | } | 327 | } |
-
请 注册 或 登录 后发表评论