Hi,
To replace backslash for example with forwardslash using str_replace, you have to use double backslash:
$value = "\A\B\C";
$updated_value = str_replace("\\", "/", $value);
When using regular expression with preg_replace, you can do something like this:
$value = "\A\B\C";
$pattern = "/[\\\w]/";
$updated_value = preg_replace($pattern, "/", $value);