소스 검색

:bug: $Fetch提到开始避免查不到数据报错

visuddhinanda 4 년 전
부모
커밋
411949d529
1개의 변경된 파일2개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 3
      app/search/paliword_sc_pre.php

+ 2 - 3
app/search/paliword_sc_pre.php

@@ -12,7 +12,7 @@ $arrWordList = str_getcsv($word, " ");
 
 $searching = $arrWordList[count($arrWordList) - 1];
 PDO_Connect(_FILE_DB_WORD_INDEX_,_DB_USERNAME_,_DB_PASSWORD_);
-$Fetch = [];
+
 if (count($arrWordList) > 1) {
     //echo "<div>";
     foreach ($arrWordList as $oneword) {
@@ -29,6 +29,5 @@ if (count($arrWordList) > 1) {
             $Fetch[] = $value;
         }
     }
-    
+    echo json_encode($Fetch, JSON_UNESCAPED_UNICODE);
 }
-echo json_encode($Fetch, JSON_UNESCAPED_UNICODE);