从字符串中删除单引号和双引号

时间:2018-06-20 07:44:58

标签: php str-replace trim

我一直在尝试从字符串中删除双引号和单引号, 它不起作用。这是我的意思

False

我要这样修剪

text = "Plagiarism is the "wrongful appropriation" and "stealing and publication" of another author's "language";

我尝试过-没办法!

new text = "Plagiarism is the wrongful appropriation and stealing and publication of another authors language";

我什至也尝试过这个-还是没办法!

$newtext = trim(trim($text,"'"),'"');

我根本不知道我在做什么错。 请帮忙。 谢谢):

1 个答案:

答案 0 :(得分:2)

尝试以下操作:

$text = "Plagiarism is the \"wrongful appropriation\" and \"stealing and publication\" of another author's \"language";
echo str_replace( array( "'",'"' ),'',$text);