从字符串中删除单引号和双引号
Removing both single and double quotes from a string
我一直在尝试从字符串中删除双引号和单引号,
它不工作。这就是我的意思
text = "Plagiarism is the "wrongful appropriation" and "stealing and publication" of another author's "language";
我想trim这样
new text = "Plagiarism is the wrongful appropriation and stealing and publication of another authors language";
我试过了 - 不行!
$newtext = trim(trim($text,"'"),'"');
这个我也试过了,还是不行!
$newtext = str_replace( array( "'","'" ),'',$text);
我根本不知道我做错了什么。
请帮忙。
谢谢 ):
尝试以下操作:
$text = "Plagiarism is the \"wrongful appropriation\" and \"stealing and publication\" of another author's \"language";
echo str_replace( array( "'",'"' ),'',$text);
我一直在尝试从字符串中删除双引号和单引号, 它不工作。这就是我的意思
text = "Plagiarism is the "wrongful appropriation" and "stealing and publication" of another author's "language";
我想trim这样
new text = "Plagiarism is the wrongful appropriation and stealing and publication of another authors language";
我试过了 - 不行!
$newtext = trim(trim($text,"'"),'"');
这个我也试过了,还是不行!
$newtext = str_replace( array( "'","'" ),'',$text);
我根本不知道我做错了什么。 请帮忙。 谢谢 ):
尝试以下操作:
$text = "Plagiarism is the \"wrongful appropriation\" and \"stealing and publication\" of another author's \"language";
echo str_replace( array( "'",'"' ),'',$text);