0

I am trying to use an array with phpspellcheck but it seems like it is not picking up anything from the array that I have created from mysql. It works just fine with an array I manually created. Is there any suggestions? I could easily use a text file but it takes so much time to load since there are 40,000+ words I need to add to the dictionary.

Here's my function

public function get_new_words(){
    $sql = "SELECT field FROM table";

    $result = mysql_query($sql) or die(mysql_error());

    $words = array();
    while($row = mysql_fetch_assoc($result)){
    $words[] = $row['field'];
    }
    return $words;
    }

Here is how I call the function for the phpspellcheck

$getWords = get_new_words();
/* other script to make spell check run is here */
$spellcheckObject ->AddCustomDictionaryFromArray($getWords);

Thank you

4

0 回答 0