Archive for February, 2010

PHP Spell Checker v1.1

February 16th, 2010

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:


// include the class

// 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>";


For further reading about the PHP class [p2p type=”id” value=”20″ text=”read this post”].

Download the class from here

VN:F [1.9.22_1171]
Rating: 7.7/10 (15 votes cast)