我试图'用另一个quote(’)替换单引号(),但我似乎无法得到任何工作.另外,如何在多个字符串上进行此操作($text, $title, $notice)?
输入:不要
输出:不要
我在尝试这个:
$text = str_replace(array("'",'"'), array('’'), $text);
$text = htmlentities(str_replace(array('"', "'"), '’', $text);
$text = htmlentities(str_replace(array('"', "'"), '’', $_POST['text']));
$text = str_replace("'" ,"’",$text);
$text = str_replace("'" ,"’",$text);
$text = str_replace(array("'"), "’", $text);
$text = str_replace(array("\'", "'", """), "’", htmlspecialchars($text));
$text = str_replace(array('\'', '"'), '’', $text);
$text = str_replace(chr(39), chr(146), $text);
$text = str_replace("'", """, $text);
Run Code Online (Sandbox Code Playgroud)
这些都不起作用.