Hi I am working with the pspell functions for the first time and it is going well except for i can replace the words with correctly which has nothing do to pspell but with my poor abilities to handle ereg_replace.
here is kind of the code i am using:
$body = "word wrod, rong wrong";
$bodywords = preg_split("/\s+/",$body);
for ($i=0;count($bodywords)>$i;$i++) {
$word = ereg_replace("[a-zA-Z]","",$bodywords[$i]);
if (!(pspell_check ($pspell_link, "$word"))) {
$badwords[] = $word;
$body = eregi_replace("$word", "<font color='red'>$word</font>", $body);
}
}
so when this replaces the words it replace partial words like rong was a "badword" so replace the wrong with w<font color='red'>rong</font>
I am trying to find a way to say just the word so that it either has a space before and after it or a "," or is the beginning or end a line. thanks for any help