Php 从字符串中删除单引号和双引号
我正在尝试从字符串中删除双引号和单引号, 它不起作用。这就是我的意思Php 从字符串中删除单引号和双引号,php,str-replace,trim,Php,Str Replace,Trim,我正在尝试从字符串中删除双引号和单引号, 它不起作用。这就是我的意思 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
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,"'"),'"');
我甚至也试过这个-还是不行
$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);
我尝试添加斜杠,但没有效果-str_replace(数组(“'”,“”),“'”,addslashes($text))