标签: php regex replace
有谁知道如何用两个反斜杠替换反斜杠?使用Perl,我会这样做:
$str = "C:\\Pub"; # Stores C:\Pub $str =~ s/\\/\\\\/g; print $str; # Outputs C:\\Pub
我可以在PHP中执行类似的操作吗?我尝试了preg_replace()功能,但它没有用!
preg_replace()