Image

Imagespacefem wrote in Imagephp

converting smart quotes

I've got a text area field where people frequently cut-copy-paste from MS word, and the smart quotes that word puts in won't work for the application.

So I want to convert the smart quotes (“, ”) into normal quotes ". So first I tried doing a str_replace that looks for the HTML character code (like ”), that didn't work. I tried copying ” directly into my php code str_replace function... that didn't work. htmlentities doesn't seem to convert the quotes to their character codes for some reason, I tried using ISO-8859-1 and UTF-8.

so! suggestions?



edit: problem solved by using chr(147) & chr(148) in the str_replace function. thanks Imagepowerlord.