I have json data as a string that is being passed to javascript. Before the string is passed though, I am doing a search in php for all double quotes and replacing them. This is working fine but some of the json strings have (what looks like) an MS Word style double quote, possibly italicized. So my <?php $t = str_replace("”", "", $t); ?> method call is not escaping the special double quotes.
Do I need to find the charcode and escape that? I tried splicing the quote out of the string and then pasting it into the php method but it still won’t recognize the character as a different double quote.
Let me see if I can paste the quote in here — < “ > and < ” >
thank you.
http://php.net/manual/en/ref.mbstring.php
http://www.regular-expressions.info/unicode.html
i would suggest to use preg_replace instead
this might be useful as well:
http://axonflux.com/handy-regexes-for-smart-quotes