将php中的单引号和双引号替换为打字机引号


Replace single and double reversed quotes to typewriter quotes in php

我正在尝试使用str_replace方法在PHP中单反向和双反向引用,但它没有被替换。我试图使用htmlentities()转换它,并使用它们的html值替换它,但它也不起作用。

代码如下:

$text = htmlspecialchars($text, ENT_QUOTES, "UTF-8");
$text = str_replace("‛", "'", $text);

尝试2:

$text = str_replace("‛", "'", $text);

单引号和双引号引用:http://en.wikipedia.org/wiki/Quotation_mark_glyphs

@Eugene应该是这个。你忘了_decode

$text = str_replace(htmlspecialchars_decode("‛"), "'", $text);

应该可以:

$text = str_replace(htmlspecialchars("‛"), "'", $text);