正在显示
1 个修改的文件
包含
3 行增加
和
7 行删除
| @@ -166,15 +166,11 @@ class ProofreadingController extends BaseController | @@ -166,15 +166,11 @@ class ProofreadingController extends BaseController | ||
| 166 | preg_match_all($pattern, $strippedContent, $matches); | 166 | preg_match_all($pattern, $strippedContent, $matches); |
| 167 | $data = []; | 167 | $data = []; |
| 168 | $textContentArray = $matches[1]; | 168 | $textContentArray = $matches[1]; |
| 169 | + $textContentArray = array_filter($matches[1], function($item) { | ||
| 170 | + return !empty(trim($item)); | ||
| 171 | + }); | ||
| 169 | var_dump($textContentArray); | 172 | var_dump($textContentArray); |
| 170 | die(); | 173 | die(); |
| 171 | -// $textContentArray = array_filter(, function($item) { | ||
| 172 | -// if(!empty($item)){ | ||
| 173 | -// $content = trim($item); | ||
| 174 | -// $trimmedString = preg_replace('/\s+/', ' ', $content); | ||
| 175 | -// $data[] = $trimmedString; | ||
| 176 | -// } | ||
| 177 | -// }); | ||
| 178 | $uniqueArray = array_unique($data); | 174 | $uniqueArray = array_unique($data); |
| 179 | $textContentArray = array_values($uniqueArray); | 175 | $textContentArray = array_values($uniqueArray); |
| 180 | return $textContentArray; | 176 | return $textContentArray; |
-
请 注册 或 登录 后发表评论