Browse Source

超过一个词返回空数组

visuddhinanda 4 years ago
parent
commit
67c9a909e0
1 changed files with 3 additions and 2 deletions
  1. 3 2
      app/search/paliword_sc_pre.php

+ 3 - 2
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,5 +29,6 @@ if (count($arrWordList) > 1) {
             $Fetch[] = $value;
         }
     }
-    echo json_encode($Fetch, JSON_UNESCAPED_UNICODE);
+    
 }
+echo json_encode($Fetch, JSON_UNESCAPED_UNICODE);