Here is the index.php
<input type='text' size='90' name='search' onKeyPress='<?php spellcheck($search); ?>'>
<input type='submit' name='submit' value='Search source code' ></br></br></br>
And here is where checking is suppose to be done.
checker.php
<?php
function spellcheck ( $string ) {
$words = preg_split('/[\W]+?/',$string);
$misspelled = $return = array();
$int = pspell_new('en');
foreach ($words as $value) {
if (!pspell_check($int, $value)) {
$misspelled[] = $value;
}
}
foreach ($misspelled as $value) {
$return[$value] = pspell_suggest($int, $value);
}
return $return;
}
?>
I want to have the same function like in google every time i have my spelling wrong it has underline on it. How can i do that?