|
...
|
...
|
@@ -181,12 +181,12 @@ class TranslateLogic extends BaseLogic |
|
|
|
$textContentArray = array_filter($matches[1], function($item) {
|
|
|
|
return !empty(trim($item));
|
|
|
|
});
|
|
|
|
// $contentData = [];
|
|
|
|
// foreach ($textContentArray as $v){
|
|
|
|
// $content = trim($v);
|
|
|
|
// $trimmedString = preg_replace('/\s+/', ' ', $content);
|
|
|
|
// $contentData[] = $trimmedString;
|
|
|
|
// }
|
|
|
|
$contentData = [];
|
|
|
|
foreach ($textContentArray as $v){
|
|
|
|
$content = trim($v);
|
|
|
|
$trimmedString = preg_replace('/\s+/', ' ', $content);
|
|
|
|
$contentData[] = $trimmedString;
|
|
|
|
}
|
|
|
|
$contentData = array_values($textContentArray);
|
|
|
|
$pattern = '/<meta\s+[^>]*name=[\'"](keywords|description)[\'"][^>]*content=[\'"]([^\'"]+)[\'"]>/i'; // 匹配 name 为 "keywords" 或 "description" 的 meta 标签的正则表达式
|
|
|
|
$matches = array();
|
...
|
...
|
|