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