Posted by dkirkdrei on 09/22/07 00:31
I am having a bit of trouble trying to double up on slashes in a file
path. What I am trying to do is very similar to the code below:
<?
$var = "\\wusais\Intranets\Intranets\fpdb\pdf\weinig\00505882.pdf";
$new = preg_replace("\\", "\\\", "$var");
?>
Code above produces the following error:
Parse error: parse error, unexpected T_VARIABLE in c:\Inetpub\wwwroot
\pages\replace.php on line 12
In the end, $new needs to be: \\\\wusais\\Intranets\\Intranets\\fpdb\
\pdf\\weinig\\00505882.pdf
but it seems to be very difficult replacing slashes.
Any help would be greatly appreciated
[Back to original message]
|