我正在使用它,但它不起作用:
$replaced = str_replace(''', '"', $text);
任何帮助都将不胜感激。
答案 0 :(得分:9)
试试这个:
$replaced = str_replace('\'', '"', $text);
OR
$replaced = str_replace("'", '"', $text);
答案 1 :(得分:0)
$replaced = str_replace('\'', '"', $text);
答案 2 :(得分:-3)
str_replace(array(" ' ", " \" ", " " "), " ", htmlspecialchars($variable ) );