作者 lyh

gx

@@ -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 }