Page 1 of 1

Replace double quotes with " ?

Posted: Tue Mar 30, 2010 4:04 pm
by chizeng
Hello all,

I am trying to replace all double quotes with " on a php string. Here is the code I am attempting:

Code: Select all

str_replace('"','"',$str);
However, the code doesn't seem to be working. I do not want to use htmlspecialchars(), since I only want to convert double quotes, not < or >.

Any help would be much valued. Thanks so much,


Chi

Re: Replace double quotes with &quot; ?

Posted: Tue Mar 30, 2010 4:21 pm
by AbraCadaver

Code: Select all

$str = str_replace('"','"',$str);