Re: [PHP] getting rid of bad characters

2005-10-31 Thread Richard Lynch
On Mon, October 31, 2005 9:30 am, Dan McCullough wrote: > I having been looking for some snippet to help me with changing MS > Word double, quotes, single quotes and other characters to acceptable > HTML safe characters. The problem comes about when the people using > the forms paste large article

Re: [PHP] getting rid of bad characters

2005-10-31 Thread Chris Shiflett
Dan McCullough wrote: I having been looking for some snippet to help me with changing MS Word double, quotes, single quotes and other characters to acceptable HTML safe characters. This seems to work: $search = array('/[\x07\x95]/', '/\x85/', '/[\x91\x92]/',

Re: [PHP] getting rid of bad characters

2005-10-31 Thread tg-php
Have you tried using htmlentities()? It should convert stuff like double-quotes (") to it's associated HTML entity which, when echo'd to the browser, will be displayed as " again. Good for safe output. Not so good for storing in a database (which you'd probably want to use whatever your datab