RE: [PHP] Special HTML characters question.
| From: | Jay Blanchard | Date: | Mon, 22 Aug 2005 13:42:14 +0000 |
| Subject: | RE: [PHP] Special HTML characters question. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-221086@lists.php.net to get a copy of this message | ||
[snip]
I have a problem that I'm sure some of you have run into before,
therefore I hope you all know of an easy solution. Some of my users
are cutting and pasting text from Word into text fields that are being
saved into a database then from that database being displayed on a web
page. The problem occurs when some special characters are being used.
Double quotes, single quotes, and other characters like accents etc
have the special html code like "e; etc replacing the special
characters. What methods are being used to combat this issue? Is
there a solution out there to run text through some sort of filter
before submitting it to the database to look for these special
characters and then replacing them?
[/snip]
Start here http://www.php.net/htmlentities . You can
also use any number
of REGEX functions for replacing them http://www.php.net/regex