Re: [PHP] Replacing a special character

2010-04-18 Thread Michael Stroh
That did it! Thanks! Michael On Apr 18, 2010, at 2:44 PM, Mari Masuda wrote: > Maybe you could try to assign the return value of preg_replace to a variable > so you can use it later, like: > > $name = preg_replace('/−/','-',$name); > > > On Apr 18, 2010, at 11:38 AM, Michael Stroh wrote: >

Re: [PHP] Replacing a special character

2010-04-18 Thread Mari Masuda
Maybe you could try to assign the return value of preg_replace to a variable so you can use it later, like: $name = preg_replace('/−/','-',$name); On Apr 18, 2010, at 11:38 AM, Michael Stroh wrote: > Thanks for the advice. I've changed the code to use mysql_real_escape_string. > So now it is

Re: [PHP] Replacing a special character

2010-04-18 Thread Michael Stroh
Thanks for the advice. I've changed the code to use mysql_real_escape_string. So now it is $name = mysql_real_escape_string($name); preg_replace('/−/','-',$name); but it's still not replacing the − string. I've also changed the field in the database so that now it is using the collation utf

Re: [PHP] Replacing a special character

2010-04-18 Thread Michiel Sikma
On 18 April 2010 16:46, Peter Lind wrote: > On 18 April 2010 16:40, Phpster wrote: > > > > > > On Apr 18, 2010, at 8:59 AM, Michael Stroh wrote: > > > >> I have this form that people use to add entries into a MySQL database. > >> Recently I've had some users insert − in their entries instead of

Re: [PHP] Replacing a special character

2010-04-18 Thread Peter Lind
On 18 April 2010 16:40, Phpster wrote: > > > On Apr 18, 2010, at 8:59 AM, Michael Stroh wrote: > >> I have this form that people use to add entries into a MySQL database. >> Recently I've had some users insert − in their entries instead of - which is >> causing some issues with scripts down the l

Re: [PHP] Replacing a special character

2010-04-18 Thread Phpster
On Apr 18, 2010, at 8:59 AM, Michael Stroh wrote: I have this form that people use to add entries into a MySQL database. Recently I've had some users insert − in their entries ins tead of - which is causing some issues with scripts down the line. I 'd like to replace the − character with -

[PHP] Replacing a special character

2010-04-18 Thread Michael Stroh
I have this form that people use to add entries into a MySQL database. Recently I've had some users insert − in their entries instead of - which is causing some issues with scripts down the line. I'd like to replace the − character with -. Originally I had something like $name = mysql_escape_