Jump to content

pspell help


tonynoriega

Recommended Posts

hello all..

 

i have a form with a <textarea> that my clients want to have a spell checker for.

 

i found this snippet, but am very novice to PHP and need some help

 

i figured i could put the below snipped in a file called spellcheck.php

 

then on my form have: <a href="spellcheck.php>Spell Check</a>

 

what do i replace the variable $str with?

 

<?

$str = "ceck this sentenc. Help me!";

 

$dict = pspell_new("en", "british");

$words = str_word_count($str, 1);

 

foreach($words as $v){

if(!pspell_check($dic, $v)){

$errors[] = $v;

}

}

 

if(sizeof($errors) > 0){

echo "error words: ".implode(", ",$errors);

}

 

?>

Link to comment
https://forums.phpfreaks.com/topic/90782-pspell-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.