Re: [PHP] Special HTML characters question.

2005-08-23 Thread Richard Lynch
On Mon, August 22, 2005 6:29 am, Jay Paulson wrote: > 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 th

Re: [PHP] Special HTML characters question.

2005-08-22 Thread Jordan Miller
Did you try html_entity_decode? http://us2.php.net/html_entity_decode You may want to combine this with mysql_real_escape_string()...? Jordan On Aug 22, 2005, at 8:29 AM, Jay Paulson wrote: I have a problem that I'm sure some of you have run into before, therefore I hope you all know of an

Re: [PHP] Special HTML characters question.

2005-08-22 Thread Shafiq Rehman
Hi, Here are two routines for your problem. function htmlentities2($myHTML) { $translation_table=get_html_translation_table (HTML_ENTITIES,ENT_QUOTES); $translation_table[chr(38)] = '&'; return preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/","&" , strtr($myHTML, $translation_table)); }

Re: [PHP] Special HTML characters question.

2005-08-22 Thread Jay Paulson
:42:14 AM -0500 From: Jay Blanchard <[EMAIL PROTECTED]> To: Jay Paulson <[EMAIL PROTECTED]>, php-general@lists.php.net Subject: RE: [PHP] Special HTML characters question. [snip] I have a problem that I'm sure some of you have run into before, therefore I hope you all know of

Re: [PHP] Special HTML characters question.

2005-08-22 Thread Jay Paulson
Thanks for the reply. I would imagine there are a lot of special html characters that would need to be changed using regex. Therefore, spending my time making a regex to find a replace each one of them isn't a good way to spend my time or even if I did go that route I'm sure it's uses too muc

RE: [PHP] Special HTML characters question.

2005-08-22 Thread Jay Blanchard
[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 p

[PHP] Special HTML characters question.

2005-08-22 Thread Jay Paulson
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