Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004

    Unanswered: how can I seprate normal text from html tags spell check it & then again place it ins

    I am devloping a spell check utility using PHP4.2.2 on Redhat9, Apache & Netscape7.1.
    I have devloped it successfully for normal text.
    but problem comes when I try to check spellings in html formated text.

    heres how it works
    I have one php named compose_richtext.php. I have provided a toolbar which I got from here user can type formated text. Their is in built feature given in that toolbar for spell check but I don't want to use that for some reasons. So I implemnted my own code.
    when user clicks on spell check the whole data is passed to next page i.e Spellcheck.php their I am using pspell_check & pspell_suggest for spellchecking.
    But the problem is how to distinguish actual text from html tags. I looked in php manual & found


    but I don' think this will work for me.
    I can easily use strip_tags but then I will loose all the tags so how will I place the actual text again in formated form.

    I read something like tidy->ishtml is their but that don't works with php4.2.2 also I was unable to find proper documantation of how to use it.

    So can u please help me & tell me that how can I seprate normal text from html tags spell check it & then again place it inside html tags.


  2. #2
    Join Date
    Jul 2004
    I think I would use preg_replace...and replace anything that matches <?>

    However if the user has something like that which they DO want to be included in the text, it will not work correctly.

    Perhaps use the function strip_tags()?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts