作者 lyh

gx

@@ -250,7 +250,12 @@ class ProofreadingController extends BaseController @@ -250,7 +250,12 @@ class ProofreadingController extends BaseController
250 $context = stream_context_create($contextOptions); 250 $context = stream_context_create($contextOptions);
251 $sourceCode = file_get_contents($url, false, $context); 251 $sourceCode = file_get_contents($url, false, $context);
252 preg_match_all($pattern, $sourceCode, $matches); 252 preg_match_all($pattern, $sourceCode, $matches);
253 - $imageLinks = $matches[1];  
254 - return $imageLinks; 253 + $textContentArray = array_filter($matches[1], function($item) {
  254 + return !empty(trim($item));
  255 + });
  256 + $data = array_values($textContentArray);
  257 + $uniqueArray = array_unique($data);
  258 + $data = array_values($uniqueArray);
  259 + return $data;
255 } 260 }
256 } 261 }