Now: Tutorial for Web and Software Design > PHP > QA > PHP Content
> PHPFAQ - Is it possible to spell check texts from php? [Bookmark it]
PHPFAQ - Is it possible to spell check texts from php?


Question :

Is it possible to spell check texts from php?

Answer :Yes as most other things spell checking is also possible from php, to do so you need to compile / activate the pspell/aspell lib. For an example of using the pspell lib from php read this article from zend http://www.zend.com/zend/spotlight/spellchecking.php

Although the pspell/aspell lib's need installing on the server only --with-pspell needs to be added to the PHP configuration.

The following code seems to work :-


<?
// /home/username/dict/ Must be world read/write
//
$pspell_link = pspell_new_personal ("/home/username/dict/custom.pws", "en", "", "", "",PSPELL_FAST|PSPELL_RUN_TOGETHER);
$word = "spelllng";

echo "The word '$word' was not spelled correctly<P>"; 

echo "Possible correct spellings are: <BR>"; 
$suggestions = pspell_suggest ($pspell_link, $word);
for ($i=0; $i < count ($suggestions); $i++) 
{
        echo "Possible spelling: " . $suggestions[$i] . "<br>"; 
}

echo "<BR>"; 
?>



[Bookmark][Print] [Close][To Top]
  • Prev Article-PHP:

  • Next Article-PHP:
  • Related Materias
    PHPFAQ - How google is you
    PHPFAQ - Are there any web
    PHPFAQ - How can I accept 
    PHPFAQ - How can I finance
    PHPFAQ - Where can I get P
    PHPFAQ - Where can I host 
    PHPFAQ - Where can I find 
    PHPFAQ - I am trying to cr
    PHPFAQ - Is there a librar
    PHPFAQ - How can I manage 
    Topics
    Photoshop Tutorial
     

    Special Effect

      3D Effect
      Photoshop Articles
    Programming Tutorial
     

    C/C++ Tutorial

      Visual Basic
      C# Tutorial
    Database Tutorial
     

    MySQL Tutorial

      MS SQL Tutorial
      Oracle Tutorial
    Graphic Design Tutorial
     

    Coreldraw Tutorial

      Illustrator Tutorial
      3D Graphics Articles
    Webmaster Articles
     

    Domain Service

      Web Hosting
      Site Promotion
    Java Tutorial&Articles
     

    Java Servlets

      JavaEE Tutorial
     

    JavaBeans Tutorial

    XML Tutorial&Articles
     

    XML Style Tutorial

      AJAX Tutorial
      XML Mobile
    Flash Tutorial&Articles
     

    Flash Video

      Action Script
      Flash Articles
    OS Tutorial&Articles
     

    Linux Tutorial

      Symbian Tutorial
      MacOS Tutorial