试试这个功能:
function convert_smart_quotes($string)
{
$string = htmlentities($string);
$string = mb_convert_encoding($string, 'HTML-ENTITIES', 'utf-8');
$string = htmlspecialchars_decode(utf8_decode(htmlentities($string, ENT_COMPAT, 'utf-8', false)));
$s = array(
chr(145) => "'",
chr(146) => "'",
chr(147) => '"',
chr(148) => '"',
chr(151) => '-',
's©' => '©',
'®' => '®',
'™' => '™', //™
'“' => '"', // left side double smart quote
'â€' => '"', // right side double smart quote
'‘' => "'", // left side single smart quote
'’' => "'", // right side single smart quote
'…' => '...', // elipsis
'—' => '-', // em dash
'–' => '-', // en dash
);
return strtr($string, $s);
}