replace / with \

replace
/
with
\

'C:\Mail-Backup\2012\1\2\'

so I can href a local link  

note that the
\
may need to be escaped
LVL 1
rgb192Asked:
Who is Participating?
 
käµfm³d 👽Connect With a Mentor Commented:
$result = str_replace("\\", "/", $original);

Open in new window


http://php.net/manual/en/function.str-replace.php
0
 
Ray PaseurConnect With a Mentor Commented:
There is a context-aware, predefined PHP constant for the "right kind" of slash.  It is DIRECTORY_SEPARATOR.
http://php.net/manual/en/dir.constants.php
0
 
rgb192Author Commented:
one answer is what I asked for, another provided more information to get to the root directory of the problem
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.