0

I'm using   but getting � on my email. How can I fix this?

コードの一部:

    $review = "
        <table width='100%' border='0'>
        <tr>
            <td class='text_font' >Customer Name:&nbsp;&nbsp; $account_nam</td>
        </tr>
        </table>";

次のように表示されます

顧客名:�� サンプル口座名

これも:

<td width='20%' style='border-bottom: 1px solid #CECECE;'></td>

<td>値はありませんが、面白い記号が表示されます �</p>

4

3 に答える 3

0

MS Word からテキストをインポートした可能性があります。Word には、斜めの引用符などの奇妙な文字がいくつかあります。

ダリルがコメントで示唆しているように使用できますがhtmlentities、過去に、これらの文字を次のように str_replace する必要があることがわかりました。

$text = str_replace("&ldquo;", '"', $text);
$text = str_replace("&rdquo;", '"', $text);
$text = str_replace("&lsquo;", "'", $text);
$text = str_replace("&rsquo;", "'", $text);
$text = str_replace("&hellip;", '...', $text);
$text = str_replace("&ndash;", '-', $text); 
于 2013-08-22T07:57:30.393 に答える