Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

replace / with \

Posted on 2013-02-04
3
Medium Priority
?
168 Views
Last Modified: 2013-02-05
replace
/
with
\

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

so I can href a local link  

note that the
\
may need to be escaped
0
Comment
Question by:rgb192
3 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 1000 total points
ID: 38853799
$result = str_replace("\\", "/", $original);

Open in new window


http://php.net/manual/en/function.str-replace.php
0
 
LVL 111

Assisted Solution

by:Ray Paseur
Ray Paseur earned 1000 total points
ID: 38854750
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
 

Author Closing Comment

by:rgb192
ID: 38856225
one answer is what I asked for, another provided more information to get to the root directory of the problem
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question