|
...
|
...
|
@@ -164,16 +164,19 @@ class ProofreadingController extends BaseController |
|
|
|
$pattern = '/>([^<]+)</'; // 定义匹配中间内容不是标签的正则表达式
|
|
|
|
$matches = array();
|
|
|
|
preg_match_all($pattern, $strippedContent, $matches);
|
|
|
|
$data = [];
|
|
|
|
$textContentArray = $matches[1];
|
|
|
|
$textContentArray = array_filter($matches[1], function($item) {
|
|
|
|
return !empty(trim($item));
|
|
|
|
});
|
|
|
|
var_dump($textContentArray);
|
|
|
|
die();
|
|
|
|
$uniqueArray = array_unique($data);
|
|
|
|
$textContentArray = array_values($textContentArray);
|
|
|
|
$uniqueArray = array_unique($textContentArray);
|
|
|
|
$textContentArray = array_values($uniqueArray);
|
|
|
|
return $textContentArray;
|
|
|
|
$data = [];
|
|
|
|
foreach ($textContentArray as $v){
|
|
|
|
$content = trim($v);
|
|
|
|
$trimmedString = preg_replace('/\s+/', ' ', $content);
|
|
|
|
$data[] = $trimmedString;
|
|
|
|
}
|
|
|
|
return $data;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
...
|
...
|
|