作者 lyh

gx

... ... @@ -166,15 +166,11 @@ class ProofreadingController extends BaseController
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();
// $textContentArray = array_filter(, function($item) {
// if(!empty($item)){
// $content = trim($item);
// $trimmedString = preg_replace('/\s+/', ' ', $content);
// $data[] = $trimmedString;
// }
// });
$uniqueArray = array_unique($data);
$textContentArray = array_values($uniqueArray);
return $textContentArray;
... ...