How to convert word text data into html using PHP
I have a html text area where users can add any text. What I want is if a user copies text from his word document or rtf and put into the text area, that text should be formatted into html using html.
I have used php's nl2br function but it just creates new lines. What I want is if there are any headings, bold, bullets in word, then they should be converted into html.
Any help will be of great use.
Use tinymce. It has a function that do exactly what you are asking. Just to clarify, this is a client-side script. Anyway, your user will always pass through the text area (part of a form), so it can be used and works well.
If you are talking about posting data then use
htmlspecialcharsto avoid HTML tags