试图找出解码。我想结束最通用的文本。 Elipsis to'...'花式引用单引号或双引号,常规旧' - '不是emdash。除了str_replace之外,还有另外一种方式来创建一个花式表与常规字符串表吗?html_entity_decode为纯文本或不是utf(elipsis为...等)
$str = 'Hey,…I came back….ummm,…OK,…cool';
echo htmlspecialchars_decode($str, ENT_QUOTES) ;
// Hey,…I came back….ummm,…OK,…cool
echo html_entity_decode($str, ENT_QUOTES, 'ISO-8859-15') ;
// Hey,…I came back….ummm,…OK,…cool
echo html_entity_decode($str, ENT_QUOTES, 'UTF-8') ;
//this works, but changes to the elipse character
// Hey,…I came back….ummm,…OK,…cool
echo str_replace("…", "...", $str) ;
//Hey,...I came back....ummm,...OK,...cool
//desired result
请参阅['strtr()'函数](http://www.php.net/manual/en/function.strtr.php) – SDC 2013-02-28 17:16:29