Trying to use preg_replace to change a single backslash to a double backslash as in c:\windows to c:\windows....
However I can't figure out how... even after reading all the docs and notes on php.net... any clues ?
Cheers,
Oops - meant replace not match....
to find a single backslash, you need four backslashes in your pattern. in the replacement argument, double backslashes need to be escaped as well, so it might look like preg_replace("/\\/", "\\\\", $str);
why not use addslashes();