A new version of PHP Spell Checker is available.
The new feature is checking the spelling with Google’s “Did you mean” feature, so not a big update, but useful non the less.
The syntax is the same:
<?php
// include the class
require_once(dirname(__FILE__)."/../GDYMSpellChecker.class.php");
// instantiate the class
$spellCheck = new GDYMSpellChecker();
$textWithErrors = "PHP: the quik browm fox jumps over the lazi dog lazi today"; // this text has 3 errors
$result = $spellCheck->checkSpelling($textWithErrors, "en-US"); // will return an array with the wrong words with associated suggestions
//$result = $spellCheck->checkSpelling($textWithErrors, "en-US", false); // will return an array with the wrong words without associated suggestions
//print_r($spellCheck->getWarnings());// get all warnings
//print_r($spellCheck->getErrors());// get all errors
if (count($result) == 0) {
print "Text is OK !<br/>";
} else {
print "Text has errors !<br/>";
print "<pre>";
print_r($result);
}
?>
For further reading about the PHP class read this post.


