tags:

views:

50

answers:

2

Hi,

I know this sounds simple, and probably is, but I can't seem ot get this working. Just want to replace all occurences of a double quote with a single quote...tired this but it doesn't work:

$con = str_replace("\"", "'", $content);
+1  A: 

Or:

$con = str_replace(chr(34), chr(39), $content);

Andrei Serdeliuc
Your previous answer seemed to work ;)
elduderino
A: 

What you do is correct and should work. If it doesn't, then you may only SEE double quotes, but in reality these are other characters. Possible is html " character rendered as ". There are also several chars very similar to double quotes. hey 'happen' especially when pasting text from word or openoffice. You'll include all possibilities in str_replace (it can take arrays of strings as parameters).

Tomasz Struczyński