I am trying to take paths like this:
some/path/here some\\other\\path
and replace each slash in the paths with PHP\'s DIRECTORY_SEPARATOR built in constant>
It should replace, not add. But try this:
preg_replace('/[\\]/', DS, $subject);
Should also work.