如何使用php在字符串中用双后斜杠'\\'替换特殊字符反斜杠'\'?

时间:2018-05-17 13:01:55

标签: php replace backslash

这是我的示例字符串

$str = "The ADE/Op's.(\\localhost\corporateoffice\COMMERCIAL\EODB Feedback\EODBfeedbacklist.xls) are contacted personally and see that positive feedback  "

1 个答案:

答案 0 :(得分:0)

试试这个,

$var=str_replace('\\','\\\\',$str);
 echo $var;

双反斜杠是为了逃避角色