I moved a bunch of php code over to a new server. Part of the code was responsible for gerating a daily email. The editor uses Microsoft Word. On the old server, the code ran fine (PHP 4.x; Apache 1.4) however on the new server (PHP 5.x; Apache 2.x) the code looks fine all the way till the reception of the email. The email displays gibberish in place of the MS 'smart' quotes.
So - I decided to just get rid of the smart quotes before sending. The code I need to clean up looks like this if you open it in VI :
This is a double quote open - â<80><9c> and a close â<80><9d>^M
<p>^M
This is a single quote open -- â<80><98> and a close -- â<80><99>
I found a few lines of code on the net to replace these stupid characters. it is:
$chrs = array (chr(150), chr(147), chr(148), chr(146));
$repl = array ("-", "\"", "\"", "'");
$HTMLcontent = str_replace($chrs, $repl, $HTMLcontent);
However, it does not recognize and replace the smart quotes so I am still left with gibberish in the email. The gibberish looks like this:
This is a double quote open - â¬S and a close â¬
This is a single quote open -- â¬Ü and a close -- â¬"
Any suggestions on how to get this problem resolved?
Start Free Trial